Skip to content

Commit

Permalink
added flag for netcdf files
Browse files Browse the repository at this point in the history
  • Loading branch information
AminIlia-NOAA committed Feb 28, 2025
1 parent b1ffeb2 commit 7e46202
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions parm/ocnicepost/ice_mx025_to_0p25.nml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ sinvar=''
cosvar=''
angvar='ANGLET'
grib2=.true.
ncf=.false.
debug=.false.
/
1 change: 1 addition & 0 deletions parm/ocnicepost/ocean_mx025_to_0p25.nml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ sinvar='sin_rot'
cosvar='cos_rot'
angvar=''
grib2=.true.
ncf=.false.
debug=.false.
/
1 change: 1 addition & 0 deletions parm/ocnicepost/ocnicepost.nml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
cosvar = "{{ cosvar }}",
angvar = "{{ angvar }}",
grib2 = {{ grib2 | default('.true.') }}
ncf = {{ ncf | default('.false.') }}
debug = {{ debug | default('.false.') }}
/
3 changes: 2 additions & 1 deletion src/ocnicepost.fd/init_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module init_mod

integer :: logunit !< The log unit
logical :: grib2 !< If true, write grib2 message
logical :: ncf !< If true, write netCDF flies
logical :: debug !< If true, print debug messages and intermediate files
logical :: do_ocnpost !< If true, the source file is ocean, otherwise ice

Expand All @@ -66,7 +67,7 @@ subroutine readnml
integer :: srcdims(2), dstdims(2)

namelist /ocnicepost_nml/ ftype, srcdims, wgtsdir, dstdims, maskvar, sinvar, cosvar, &
angvar, grib2, debug
angvar, grib2, ncf, debug

! --------------------------------------------------------
! read the name list
Expand Down
8 changes: 6 additions & 2 deletions src/ocnicepost.fd/ocnicepost.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ program ocnicepost
use netcdf
use init_mod , only : nxt, nyt, nlevs, nxr, nyr, outvars, readnml, readcsv
use init_mod , only : wgtsdir, ftype, fsrc, fdst, input_file, cosvar, sinvar, angvar
use init_mod , only : do_ocnpost, debug, logunit, grib2
use init_mod , only : do_ocnpost, debug, logunit, grib2, ncf
use init_mod , only : vardefs
use arrays_mod , only : b2d, c2d, b3d, rgb2d, rgc2d, rgb3d, dstlon, dstlat, setup_packing
use arrays_mod , only : nbilin2d, nbilin3d, nconsd2d, bilin2d, bilin3d, consd2d
Expand Down Expand Up @@ -298,6 +298,8 @@ program ocnicepost
! write the mapped fields
! --------------------------------------------------------

if (ncf) then

allocate(out2d(nxr,nyr)); out2d = 0.0
allocate(out3d(nxr,nyr,nlevs)); out3d = 0.0

Expand Down Expand Up @@ -414,6 +416,8 @@ program ocnicepost
call nf90_err(nf90_close(ncid), 'close: '// trim(fout))
write(logunit,'(a)')trim(fout)//' done'

stop
end if

stop

end program ocnicepost

0 comments on commit 7e46202

Please sign in to comment.