Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single step oro & fix files generation procedure for atm and ocn res combo #830

Merged
merged 92 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
f9e63a3
Add logic to ignore soil and clay percentage records.
GeorgeGayno-NOAA May 5, 2023
26eeef1
Merge branch 'develop' into bugfix/bnu_soil
GeorgeGayno-NOAA May 31, 2023
ecf2442
Update documentation and script logs for new files.
GeorgeGayno-NOAA Jun 1, 2023
478fbde
updates done by Sanatcumar
sanatcumar Jun 15, 2023
b91b5eb
updates done by Sanatcumar
sanatcumar Jun 15, 2023
6a004a7
updates done by Sanatcumar
sanatcumar Jun 15, 2023
9d1be51
updates done by Sanatcumar
sanatcumar Jun 15, 2023
d386999
updates done by Sanatcumar
sanatcumar Jun 15, 2023
e34c7d0
updates done by Sanatcumar
sanatcumar Jun 15, 2023
2653ab2
updates done by Sanatcumar
sanatcumar Jun 15, 2023
34a8676
Removed emails and links
sanatcumar Jun 16, 2023
cbb553f
Removed input files
sanatcumar Jun 30, 2023
6a7b778
Removed input files
sanatcumar Jun 30, 2023
0b9a03e
Removed log files
sanatcumar Jun 30, 2023
d6221b3
fixed the typo in ocean merge paths
sanatcumar Jun 30, 2023
4a208a1
added explanatory comments as recomended to the ocean_merge routines
sanatcumar Jun 30, 2023
069d1bf
removed unnecessary libraries (sp) when compiling
sanatcumar Jun 30, 2023
41f87d6
fixed a broken path in ocean_merge
sanatcumar Jun 30, 2023
ab1e628
fixed a broken path to mosaic
sanatcumar Jul 5, 2023
24c93fa
removed logs
sanatcumar Jul 10, 2023
eb0a511
relocated readme, reorganized output directories, removed logs and ot…
sanatcumar Jul 10, 2023
65d34fa
added more explanatory comments to code
sanatcumar Jul 10, 2023
b74ebc8
Major revision split orog
sanatcumar Aug 10, 2023
4455d90
Major revision split orog
sanatcumar Aug 10, 2023
e700e0a
Removed logs
sanatcumar Aug 10, 2023
f4769f8
removed some old namelist files
sanatcumar Aug 10, 2023
400cc13
Merge branch 'develop' into bugfix/bnu_soil
GeorgeGayno-NOAA Aug 11, 2023
084d51c
Some script updates.
GeorgeGayno-NOAA Aug 14, 2023
c246ffc
included doxygen(TNX George)+ set ocn default
sanatcumar Aug 14, 2023
e0d86d3
updated fv3gfs_driver_grid.sh comments to the correct sequence of calls
sanatcumar Aug 14, 2023
2c9b502
updated fv3gfs_driver_grid.sh comments to the correct sequence of calls
sanatcumar Aug 14, 2023
98caf8b
Update orion driver script to use additional resources
GeorgeGayno-NOAA Aug 15, 2023
6179b24
Update jet grid driver script to request more resources
GeorgeGayno-NOAA Aug 15, 2023
fc17593
Minor updates to the wcoss2 driver grid script.
GeorgeGayno-NOAA Aug 15, 2023
22dadfe
Merge branch 'develop' into bugfix/bnu_soil
GeorgeGayno-NOAA Aug 16, 2023
6f3fe9e
Update some script comments. Update sfc_climo_gen script to use
GeorgeGayno-NOAA Aug 16, 2023
64fdfd7
Update comments in the sfc_climo_gen utility script.
GeorgeGayno-NOAA Aug 16, 2023
6e1c9b4
clean up before merge
sanatcumar Aug 17, 2023
df89e12
Update ccpp-physics submodule.
sanatcumar Aug 17, 2023
d4cfcc0
Update ccpp-physics
sanatcumar Aug 17, 2023
1105547
Merge branch 'develop' into single_step
sanatcumar Aug 17, 2023
05659d9
removed unnecessary files
sanatcumar Aug 17, 2023
6b30462
fixed a gnu compile issue split the ocean merge into a driver and script
sanatcumar Aug 17, 2023
4b3b25f
cleaned up the driver, fix gnu compile, split the ocean merge
sanatcumar Aug 17, 2023
156bd27
Merge branch 'bugfix/bnu_soil' into single_step
sanatcumar Aug 18, 2023
8284cbe
Cleaned up old directories and included print messages for debugging …
sanatcumar Aug 25, 2023
0f60b72
fixed possible misleading errors in merge_lake_ochmsk.f90, fixed logi…
sanatcumar Aug 29, 2023
36d6ec4
inlcudes a readme file for all options
sanatcumar Sep 5, 2023
5dc234d
included logic to bypass when ocn is not set
sanatcumar Sep 8, 2023
ce8b596
Do not use the prev #.
sanatcumar Sep 8, 2023
276f846
Now can run other grid type options as usual
sanatcumar Sep 11, 2023
4769aea
Fixed issues with running other versions
sanatcumar Sep 11, 2023
df2420b
Updated the comments in the driver scripts
sanatcumar Sep 12, 2023
b24724f
updated origin and formated coments
sanatcumar Sep 12, 2023
28f6ef4
Merge branch 'ufs-community:develop' into single_step
sanatcumar Sep 12, 2023
df0788d
Merge remote-tracking branch 'upstream/develop' into develop
sanatcumar Sep 27, 2023
54b5564
Merge branch 'develop' into single_step
sanatcumar Sep 27, 2023
d0e2978
Modified the ocean merge and scriptto pass the binary_lake
sanatcumar Nov 6, 2023
eadcd71
Merge remote-tracking branch 'upstream/develop' into single_step
sanatcumar Nov 6, 2023
e2fbc56
changed the output file names to follow /scratch1/NCEPDEV/global/glop…
sanatcumar Nov 8, 2023
13145aa
Fixed a typo in file name changes
sanatcumar Nov 8, 2023
e1c28f8
included the lake source data in the readme
sanatcumar Nov 9, 2023
49b131d
fixed file names to run gsl suite
sanatcumar Nov 13, 2023
a0bfb00
Merge remote-tracking branch 'upstream/develop' into single_step
sanatcumar Nov 14, 2023
1c53ea1
Included logic to work with different filenames
sanatcumar Nov 15, 2023
6e18c0f
Fixed issues with nck commands with the new libaries from last PR
sanatcumar Nov 15, 2023
76dd01a
Made filenames consistent
sanatcumar Nov 16, 2023
2941924
Included creation date to readme
sanatcumar Nov 17, 2023
eb31490
Includes Mike's fix for coastal ORO issue
sanatcumar Nov 21, 2023
7e64969
Includes Mike's coastal oro fix
sanatcumar Nov 22, 2023
451d13c
Merge remote-tracking branch 'upstream/develop' into single_step
sanatcumar Nov 22, 2023
5563ce4
tweaks to get the grid_gen test working
sanatcumar Nov 22, 2023
29774b1
inlcuding lake source data for all gtypes
sanatcumar Nov 28, 2023
10a3524
Merge remote-tracking branch 'upstream/develop' into single_step
sanatcumar Nov 28, 2023
9977d8b
Tweaks to get gridgen tests working. Includes checking for uniform an…
sanatcumar Nov 29, 2023
3151f77
includes Doxygen edits
sanatcumar Nov 30, 2023
28a4cdb
Included newer variables in driver scripts for other machines
sanatcumar Nov 30, 2023
ccc72e3
Updated path for ocean merge files on orion
sanatcumar Nov 30, 2023
291ba43
Includes logic by George to stop on error in the ocean merge routines
sanatcumar Nov 30, 2023
07fdec3
Removed personal links except "ocean merge" and merged conflicts
sanatcumar Dec 1, 2023
c11ddcf
Changes to test the new location for ocean masks
sanatcumar Dec 6, 2023
cefff38
testing with new fix locations
sanatcumar Dec 7, 2023
58da591
edited driver scripts for each machine
sanatcumar Dec 7, 2023
5dcb766
Tweaks to make it run with the new soft linked orog
sanatcumar Dec 7, 2023
2b362b5
Cleaned up unused variables
sanatcumar Dec 7, 2023
30e2834
Cleaning up the unnecessary changes to use the fix files
sanatcumar Dec 7, 2023
a2082c0
Tweaks recomended by George to read long filenames
sanatcumar Dec 8, 2023
2f2cb70
Reverted non relevant edits for this PR and removed a personal link
sanatcumar Dec 8, 2023
27532c9
Removed personal link in readme
sanatcumar Dec 8, 2023
d5c01f6
Includes edits by george to grid_gen tests to accomodate the change f…
sanatcumar Dec 8, 2023
9d60740
Tweaks to inlcude the hash automatically in the readme file. Nice ide…
sanatcumar Dec 8, 2023
d0d1e8f
last edits to sfc_gen
sanatcumar Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 47 additions & 7 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#SBATCH -o log.fv3_grid_driver
#SBATCH -e log.fv3_grid_driver
#SBATCH --nodes=1 --ntasks-per-node=24
##SBATCH --partition=bigmem
#SBATCH --partition=bigmem
#SBATCH -q debug
#SBATCH -t 00:20:00
#SBATCH -t 00:29:00

#-----------------------------------------------------------------------
# Driver script to create a cubic-sphere based model grid on Hera.
Expand All @@ -31,6 +31,8 @@
# To run, do the following:
#
# 1) Set "C" resolution, "res" - Example: res=96.
# 1.1) Set the "ocn" resolution - Example ocn=500 or "" for none. Note: valid for uniform grid only

# 2) Set grid type ("gtype"). Valid choices are
# "uniform" - global uniform grid
# "stretch" - global stretched grid
Expand Down Expand Up @@ -86,7 +88,7 @@ export vegsoilt_frac='.false.' # When .false., output dominant soil and
# the dominant category. A Fortran logical,
# so include the dots.

export veg_type_src="modis.igbp.0.05" # Vegetation type data.
export veg_type_src="viirs.igbp.0.05" # Vegetation type data.
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
# 2) "viirs.igbp.0.05" for global 0.05-deg data
Expand All @@ -101,7 +103,7 @@ export veg_type_src="modis.igbp.0.05" # Vegetation type data.
# 4) "modis.igbp.nh.30s" for N Hemis 30s data
# 5) "modis.igbp.30s" for global 30s data

export soil_type_src="statsgo.0.05" # Soil type data.
export soil_type_src="statsgo.30s" # Soil type data.
# For STATSGO data
# 1) "statsgo.0.05" for global 0.05-deg data
# 2) "statsgo.0.03" for global 0.03-deg data
Expand All @@ -111,9 +113,14 @@ export soil_type_src="statsgo.0.05" # Soil type data.
# For Beijing Norm. Univ. data
# 1) "bnu.30s" for global 30s data.





if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
export res=96 # required atmos res, defaultes to 98
export ocn="100" # "" to ignore else "XXX" ocean grid to the atmos res from above as Cres.mxXXX
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.20 # lake frac < lake_cutoff ignored when add_lake=T
elif [ $gtype = stretch ]; then
export res=96
Expand Down Expand Up @@ -153,13 +160,46 @@ fi
# home_dir - location of repository.
# TEMP_DIR - working directory.
# out_dir - where files will be placed upon completion.
# ocean_mask_dir - where the ocn grids generated by CPLD_GRIDGEN reside
#-----------------------------------------------------------------------

export home_dir=$SLURM_SUBMIT_DIR/..
export TEMP_DIR=/scratch2/NCEPDEV/stmp1/$LOGNAME/fv3_grid.$gtype
export ocean_mask_dir=/scratch1/NCEPDEV/stmp4/Sanath.kumar/CPLD_GRIDGEN/

export out_dir=/scratch2/NCEPDEV/stmp1/$LOGNAME/my_grids

#-----------------------------------------------------------------------
export ocean_mask_dir=/scratch1/NCEPDEV/stmp4/Sanath.Kumar/CPLD_GRIDGEN/




# save a file with the various variables that was used for later reference

if [[ ! -z "$ocn" ]]; then
readme_name=$out_dir/readme.C$res.mx$ocn.txt

else
readme_name=$out_dir/readme.C$res.txt

fi

export readme_name=$readme_name


cat <<EOF >$readme_name

The following parameters were used
veg_type=$veg_type_src
soil_type=$soil_type_src
add_lake=$add_lake
lake_cutoff=$lake_cutoff

EOF



#---------------------------------------------------------------------
# Should not need to change anything below here.
#-----------------------------------------------------------------------

Expand Down
8 changes: 8 additions & 0 deletions input.nml
sanatcumar marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

&mask_nml
ocean_mask_dir="/scratch1/NCEPDEV/stmp4/Sanath.Kumar/CPLD_GRIDGEN//100/"
ocnres="mx100"
lake_mask_dir="/scratch2/NCEPDEV/stmp1/Sanath.Kumar/my_grids/C96/"
atmres="C96"
out_dir="/scratch2/NCEPDEV/stmp1/Sanath.Kumar/ocean_merged/C96.mx100/"
/
3 changes: 3 additions & 0 deletions sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ endif()
if(WEIGHT_GEN)
add_subdirectory(weight_gen.fd)
endif()

add_subdirectory(ocean_merge.fd)

26 changes: 26 additions & 0 deletions sorc/ocean_merge.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
list(APPEND fortran_src
merge_lake_ocnmsk.f90
)

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8")
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
endif()
endif()

set(exe_name ocean_merge)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}
sp::sp_d
NetCDF::NetCDF_Fortran)
GeorgeGayno-NOAA marked this conversation as resolved.
Show resolved Hide resolved

install(TARGETS ${exe_name})

# If doxygen documentation we enabled, build it.
if(ENABLE_DOCS)
add_subdirectory(docs)
endif()
155 changes: 155 additions & 0 deletions sorc/ocean_merge.fd/merge_lake_ocnmsk.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
!!! input are from pth1 and pth2, output will be in the local dir
!!! To compile, do
!!! ifort merge_lake_ocnmsk.F90 -I$NETCDF/include -L$NETCDF/lib -lnetcdff -lnetcdf
!!! created by Shan.Sun modified by Rahul Mahajan and Sanath Kumar
!!!
!!!

program merge_lake_ocnmsk
use netcdf

implicit none

character(len=120) :: pth1
character(len=120) :: pth2,pth3
character(len=10) :: atmres,ocnres
real, parameter :: min_land=1.e-4, def_lakedp=10.
logical, parameter :: int_lake=.true.

character(len=120) :: flnm
integer :: ncid,ndims,nvars,natts,lat,lon,v1id,v2id,v3id,v4id,start(2),count(2),i,j,latid,lonid,ncid4, dims(2),tile,nodp_pt,lake_pt,vlat
real, allocatable :: lake_frac(:,:),lake_depth(:,:),land_frac(:,:),ocn_frac(:,:),slmsk(:,:),lat2d(:,:)

call read_nml(pth1, pth2, atmres, ocnres, pth3)

nodp_pt=0
lake_pt=0
do tile=1,6
write(flnm,'(5a,i1,a)') trim(pth1),trim(atmres),'.',trim(ocnres),'.tile',tile,'.nc'
call handle_err (nf90_open (flnm, NF90_NOWRITE, ncid))
call handle_err (nf90_inquire (ncid, ndimensions=ndims, nvariables=nvars, nattributes=natts))
write(6,*) 'flnm_ocn=',flnm,' ncid=',ncid, ' ndims=',ndims, 'nvars=',nvars,' natts=',natts
call handle_err (nf90_inq_dimid (ncid, 'grid_xt', latid)) ! RM: lon is no longer in this file; try grid_xt
call handle_err (nf90_inq_dimid (ncid, 'grid_yt', lonid)) ! RM: lat is no longer in this file; try grid_tyt
call handle_err (nf90_inquire_dimension (ncid, latid, len=lat))
call handle_err (nf90_inquire_dimension (ncid, lonid, len=lon))
if (tile==1) then
write(6,*) 'lat=',lat,'lon=',lon
allocate (lake_frac(lon,lat),lake_depth(lon,lat),land_frac(lon,lat),ocn_frac(lon,lat),slmsk(lon,lat),lat2d(lon,lat))
start(1:2) = (/1,1/)
count(1:2) = (/lon,lat/)
end if
call handle_err (nf90_inq_varid(ncid, 'land_frac', v1id))
call handle_err (nf90_get_var (ncid, v1id, ocn_frac, start=start, count=count))

write(flnm,'(3a,i1,a)') trim(pth2),trim(atmres),'_oro_data.tile',tile,'.nc'
print *,' flnm2=',trim(flnm)
call handle_err (nf90_open (flnm, NF90_NOWRITE, ncid))
call handle_err (nf90_inquire (ncid, ndimensions=ndims, nvariables=nvars, nattributes=natts))
write(6,*) 'flnm_lake=',flnm,' ncid=',ncid, ' ndims=',ndims, 'nvars=',nvars,' natts=',natts
!if (tile==1) then
! call handle_err (nf90_inq_dimid (ncid, 'lat', latid))
! call handle_err (nf90_inq_dimid (ncid, 'lon', lonid))
! call handle_err (nf90_inquire_dimension (ncid, latid, len=lat))
! call handle_err (nf90_inquire_dimension (ncid, lonid, len=lon))
! write(6,*) 'lat=',lat,'lon=',lon
! start(1:2) = (/1,1/)
! count(1:2) = (/lon,lat/)
!end if
call handle_err (nf90_inq_varid(ncid, 'lake_frac', v2id))
call handle_err (nf90_inq_varid(ncid, 'lake_depth',v3id))
call handle_err (nf90_inq_varid(ncid, 'geolat' ,vlat))
call handle_err (nf90_get_var (ncid, v2id, lake_frac, start=start, count=count))
call handle_err (nf90_get_var (ncid, v3id, lake_depth,start=start, count=count))
call handle_err (nf90_get_var (ncid, vlat, lat2d, start=start, count=count))

do i=1,lon
do j=1,lat
if (int_lake) lake_frac(i,j)=nint(lake_frac(i,j)) ! using integer lake_frac
if (lat2d(i,j).le.-60.) lake_frac(i,j)=0. ! ignore lakes on Antarctica
land_frac(i,j)=1.-ocn_frac(i,j)
if (land_frac(i,j) < min_land) land_frac(i,j)=0. ! ignore land < min_land
if (land_frac(i,j) > 1.-min_land) land_frac(i,j)=1. ! ignore water < min_land
if (1.-land_frac(i,j) > 0.) lake_frac(i,j)=0. ! ocn dominates

if (lake_frac(i,j) > 0.) then
lake_pt=lake_pt+1 ! calculating total lake points
if (int_lake) then
land_frac(i,j)=0.
else
land_frac(i,j)=1.-lake_frac(i,j)
end if
if (lake_depth(i,j) <= 0.) then
lake_depth(i,j)=def_lakedp ! set missing lake depth to default value
nodp_pt=nodp_pt+1 ! calculating total lake points without depth
end if
else
lake_depth(i,j)=0.
end if
slmsk(i,j) = ceiling(land_frac(i,j)) ! ceiling is used for orog smoothing
end do
end do

write(flnm,'(4a,i1,a)') trim(atmres),'.',trim(ocnres),'.tile',tile,'.nc'
print *,'output=',trim(flnm)
call handle_err (nf90_create (path=trim(pth3)//trim(flnm), &
cmode=or(NF90_CLOBBER, NF90_64BIT_OFFSET), ncid=ncid4)) ! netcdf3

call handle_err (nf90_def_dim (ncid4,'lon', lon, dims(1)))
call handle_err (nf90_def_dim (ncid4,'lat', lat, dims(2)))
call handle_err (nf90_def_var (ncid4,'land_frac', nf90_float, dims(1:2), v1id))
call handle_err (nf90_def_var (ncid4,'lake_frac', nf90_float, dims(1:2), v2id))
call handle_err (nf90_def_var (ncid4,'lake_depth',nf90_float, dims(1:2), v3id))
call handle_err (nf90_def_var (ncid4,'slmsk', nf90_float, dims(1:2), v4id))

call handle_err (nf90_enddef (ncid4))

call handle_err (nf90_put_var (ncid4, v1id,land_frac))
call handle_err (nf90_put_var (ncid4, v2id,lake_frac))
call handle_err (nf90_put_var (ncid4, v3id,lake_depth))
call handle_err (nf90_put_var (ncid4, v4id,slmsk))
call handle_err (nf90_close(ncid4))

! do i=1,48
! do j=1,48
! write(*,'(2i4,4f6.1)') i,j,land_frac(i,j),lake_frac(i,j),lake_depth(i,j),slmsk(i,j)
! end do
! end do

end do ! tile
write(*,'(a,i8,a,i8,a)') 'total lake point ',lake_pt,' where ',nodp_pt,' has no depth'

end program merge_lake_ocnmsk

subroutine handle_err (ret)
use netcdf
integer, intent(in) :: ret

if (ret /= NF90_NOERR) then
write(6,*) nf90_strerror (ret)
stop 999
end if
end subroutine handle_err

subroutine read_nml(ocean_mask_dir, lake_mask_dir, atmres, ocnres,out_dir)

integer :: unit=7, io_status

character(len=120), intent(out) :: ocean_mask_dir
character(len=120), intent(out) :: lake_mask_dir
character(len=120), intent(out) :: out_dir
character(len=10), intent(out) :: atmres,ocnres

!ocean_mask_dir='/scratch1/NCEPDEV/stmp4/Sanath.Kumar/CPLD_GRIDGEN/100/' ! MOM6 mask dir
!lake_mask_dir='/scratch1/NCEPDEV/stmp4/Sanath.Kumar/CPLD_GRIDGEN/100/' ! this is for P8
!atmres='C96'
!ocnres='mx100'
!out_dir='/scratch1/BMC/gsd-fv3-dev/fv3data/edit_landfrac_mom6_nov2021/'

namelist/mask_nml/ocean_mask_dir, lake_mask_dir, atmres, ocnres, out_dir
open(unit=unit, file='input.nml', iostat=io_status )
read(unit,mask_nml, iostat=io_status )
close(unit)
if (io_status > 0) call handle_err(-1, 'Error reading input.nml')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting a warning here. Routine handle_err only takes one argument. The character sting should be removed from the argument list. That string could be printed before the call to handle_err.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed that and added a print statement to o/p the error message inside the if statement

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon closer inspection, routine handle_err is for netcdf errors. In this case, the minus 1 return code will be converted to a netcdf error message, which will be misleading to the user. Maybe, you should not call that routine and do something like this instead:

if (io_status /= 0) then
  print*,"FATAL ERROR reading namelist input.nml"
  stop 999
endif

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the insightful tip. Noted. I will make suggested change and test it. I will also clean up that code in the next commit


end subroutine read_nml
1 change: 1 addition & 0 deletions ush/fort.15
sanatcumar marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions ush/fort.235
sanatcumar marked this conversation as resolved.
Show resolved Hide resolved
Empty file added ush/fort.25
sanatcumar marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Loading