Skip to content

Commit

Permalink
add to unit test to check for 5deg destination
Browse files Browse the repository at this point in the history
* 5deg tripole has only 25 vertical levels. The 5deg RT
does run if modifications are made to use 75 levels, but
since 5deg restarts are avail from the marine DA, remapping
of the 1/4deg restarts will not be supported
  • Loading branch information
DeniseWorthen committed May 15, 2024
1 parent 22c6787 commit f03a134
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 106 deletions.
102 changes: 51 additions & 51 deletions sorc/ocnice_prep.fd/ice.csv
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
! variable name, dimension, grid location, remapping method, vector pair, grid location of vector pair
'uvel' , 2, 'Bu_x', 'bilinear', 'vvel', 'Bu_y'
'vvel' , 2, 'Bu_y', 'bilinear', 'uvel', 'Bu_x'
'coszen' , 2, 'Ct', 'bilinear', '', ''
'scale_factor' , 2, 'Ct', 'bilinear', '', ''
'swvdr' , 2, 'Ct', 'bilinear', '', ''
'swvdf' , 2, 'Ct', 'bilinear', '', ''
'swidr' , 2, 'Ct', 'bilinear', '', ''
'swidf' , 2, 'Ct', 'bilinear', '', ''
'strocnxT' , 2, 'Ct', 'bilinear', '', ''
'strocnyT' , 2, 'Ct', 'bilinear', '', ''
'stressp_1' , 2, 'Ct', 'bilinear', '', ''
'stressp_2' , 2, 'Ct', 'bilinear', '', ''
'stressp_3' , 2, 'Ct', 'bilinear', '', ''
'stressp_4' , 2, 'Ct', 'bilinear', '', ''
'stressm_1' , 2, 'Ct', 'bilinear', '', ''
'stressm_2' , 2, 'Ct', 'bilinear', '', ''
'stressm_3' , 2, 'Ct', 'bilinear', '', ''
'stressm_4' , 2, 'Ct', 'bilinear', '', ''
'stress12_1' , 2, 'Ct', 'bilinear', '', ''
'stress12_2' , 2, 'Ct', 'bilinear', '', ''
'stress12_3' , 2, 'Ct', 'bilinear', '', ''
'stress12_4' , 2, 'Ct', 'bilinear', '', ''
'iceumask' , 2, 'Ct', 'bilinear', '', ''
'fsnow' , 2, 'Ct', 'bilinear', '', ''
'aicen' , 3 , 'Ct', 'bilinear', '', ''
'vicen' , 3 , 'Ct', 'bilinear', '', ''
'vsnon' , 3 , 'Ct', 'bilinear', '', ''
'Tsfcn' , 3 , 'Ct', 'bilinear', '', ''
'iage' , 3 , 'Ct', 'bilinear', '', ''
'alvl' , 3 , 'Ct', 'bilinear', '', ''
'vlvl' , 3 , 'Ct', 'bilinear', '', ''
'apnd' , 3 , 'Ct', 'bilinear', '', ''
'hpnd' , 3 , 'Ct', 'bilinear', '', ''
'ipnd' , 3 , 'Ct', 'bilinear', '', ''
'dhs' , 3 , 'Ct', 'bilinear', '', ''
'ffrac' , 3 , 'Ct', 'bilinear', '', ''
'sice001' , 3 , 'Ct', 'bilinear', '', ''
'qice001' , 3 , 'Ct', 'bilinear', '', ''
'sice002' , 3 , 'Ct', 'bilinear', '', ''
'qice002' , 3 , 'Ct', 'bilinear', '', ''
'sice003' , 3 , 'Ct', 'bilinear', '', ''
'qice003' , 3 , 'Ct', 'bilinear', '', ''
'sice004' , 3 , 'Ct', 'bilinear', '', ''
'qice004' , 3 , 'Ct', 'bilinear', '', ''
'sice005' , 3 , 'Ct', 'bilinear', '', ''
'qice005' , 3 , 'Ct', 'bilinear', '', ''
'sice006' , 3 , 'Ct', 'bilinear', '', ''
'qice006' , 3 , 'Ct', 'bilinear', '', ''
'sice007' , 3 , 'Ct', 'bilinear', '', ''
'qice007' , 3 , 'Ct', 'bilinear', '', ''
'qsno001' , 3 , 'Ct', 'bilinear', '', ''
'uvel' , 2, 'Bu_x', 'bilinear', 'vvel', 'Bu_y'
'vvel' , 2, 'Bu_y', 'bilinear', 'uvel', 'Bu_x'
'coszen' , 2, 'Ct', 'bilinear', '', ''
'scale_factor' , 2, 'Ct', 'bilinear', '', ''
'swvdr' , 2, 'Ct', 'bilinear', '', ''
'swvdf' , 2, 'Ct', 'bilinear', '', ''
'swidr' , 2, 'Ct', 'bilinear', '', ''
'swidf' , 2, 'Ct', 'bilinear', '', ''
'strocnxT' , 2, 'Ct', 'bilinear', '', ''
'strocnyT' , 2, 'Ct', 'bilinear', '', ''
'stressp_1' , 2, 'Ct', 'bilinear', '', ''
'stressp_2' , 2, 'Ct', 'bilinear', '', ''
'stressp_3' , 2, 'Ct', 'bilinear', '', ''
'stressp_4' , 2, 'Ct', 'bilinear', '', ''
'stressm_1' , 2, 'Ct', 'bilinear', '', ''
'stressm_2' , 2, 'Ct', 'bilinear', '', ''
'stressm_3' , 2, 'Ct', 'bilinear', '', ''
'stressm_4' , 2, 'Ct', 'bilinear', '', ''
'stress12_1' , 2, 'Ct', 'bilinear', '', ''
'stress12_2' , 2, 'Ct', 'bilinear', '', ''
'stress12_3' , 2, 'Ct', 'bilinear', '', ''
'stress12_4' , 2, 'Ct', 'bilinear', '', ''
'iceumask' , 2, 'Ct', 'bilinear', '', ''
'fsnow' , 2, 'Ct', 'bilinear', '', ''
'aicen' , 3 , 'Ct', 'bilinear', '', ''
'vicen' , 3 , 'Ct', 'bilinear', '', ''
'vsnon' , 3 , 'Ct', 'bilinear', '', ''
'Tsfcn' , 3 , 'Ct', 'bilinear', '', ''
'iage' , 3 , 'Ct', 'bilinear', '', ''
'alvl' , 3 , 'Ct', 'bilinear', '', ''
'vlvl' , 3 , 'Ct', 'bilinear', '', ''
'apnd' , 3 , 'Ct', 'bilinear', '', ''
'hpnd' , 3 , 'Ct', 'bilinear', '', ''
'ipnd' , 3 , 'Ct', 'bilinear', '', ''
'dhs' , 3 , 'Ct', 'bilinear', '', ''
'ffrac' , 3 , 'Ct', 'bilinear', '', ''
'sice001' , 3 , 'Ct', 'bilinear', '', ''
'qice001' , 3 , 'Ct', 'bilinear', '', ''
'sice002' , 3 , 'Ct', 'bilinear', '', ''
'qice002' , 3 , 'Ct', 'bilinear', '', ''
'sice003' , 3 , 'Ct', 'bilinear', '', ''
'qice003' , 3 , 'Ct', 'bilinear', '', ''
'sice004' , 3 , 'Ct', 'bilinear', '', ''
'qice004' , 3 , 'Ct', 'bilinear', '', ''
'sice005' , 3 , 'Ct', 'bilinear', '', ''
'qice005' , 3 , 'Ct', 'bilinear', '', ''
'sice006' , 3 , 'Ct', 'bilinear', '', ''
'qice006' , 3 , 'Ct', 'bilinear', '', ''
'sice007' , 3 , 'Ct', 'bilinear', '', ''
'qice007' , 3 , 'Ct', 'bilinear', '', ''
'qsno001' , 3 , 'Ct', 'bilinear', '', ''
10 changes: 8 additions & 2 deletions sorc/ocnice_prep.fd/init_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ subroutine readnml(fname,errmsg,rc)
if (nxt == 1440 .and. nyt == 1080) fsrc = 'mx025' ! 1/4deg tripole
if (len_trim(fsrc) == 0) then
rc = 1
write(errmsg,'(a)')'FATAL ERROR: source grid dimensions incorrect'
write(errmsg,'(a)')'FATAL ERROR: source grid dimensions invalid'
return
end if

Expand All @@ -111,7 +111,13 @@ subroutine readnml(fname,errmsg,rc)
if (nxr == 72 .and. nyr == 35) fdst = 'mx500' ! 5deg tripole
if (len_trim(fdst) == 0) then
rc = 1
write(errmsg,'(a)')'FATAL ERROR: destination grid dimensions incorrect'
write(errmsg,'(a)')'FATAL ERROR: destination grid dimensions invalid'
return
end if

if (trim(fdst) == 'mx500') then
rc = 1
write(errmsg,'(a)')'FATAL ERROR: 5deg destination grid is not supported'
return
end if

Expand Down
2 changes: 1 addition & 1 deletion sorc/ocnice_prep.fd/ocniceprep.nml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ ftype='ocean'
wgtsdir='/scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1191124/'
griddir='/scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1191124/'
srcdims=1440,1080
dstdims=360,320
dstdims=72,35
debug=.true.
/
2 changes: 2 additions & 0 deletions tests/ocnice_prep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/invalid.srcdim.nml ${CMAKE_CURRENT_BINARY_DIR}/data/invalid.srcdim.nml)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/invalid.dstdim.nml ${CMAKE_CURRENT_BINARY_DIR}/data/invalid.dstdim.nml)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/invalid.dst5p00.nml ${CMAKE_CURRENT_BINARY_DIR}/data/invalid.dst5p00.nml)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/data/ice.badvecpairs.csv ${CMAKE_CURRENT_BINARY_DIR}/data/ice.badvecpairs.csv)
execute_process( COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
98 changes: 49 additions & 49 deletions tests/ocnice_prep/data/ice.badvecpairs.csv
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
! variable name, dimension, grid location, remapping method, vector pair, grid location of vector pair
'uvel' , 2, 'Bu_x', 'bilinear', 'vvel', 'Bu_y'
'coszen' , 2, 'Ct', 'bilinear', '', ''
'coszen' , 2, 'Ct', 'bilinear', '', ''
'vvel' , 2, 'Bu_y', 'bilinear', 'uvel', 'Bu_x'
'scale_factor' , 2, 'Ct', 'bilinear', '', ''
'swvdr' , 2, 'Ct', 'bilinear', '', ''
'swvdf' , 2, 'Ct', 'bilinear', '', ''
'swidr' , 2, 'Ct', 'bilinear', '', ''
'swidf' , 2, 'Ct', 'bilinear', '', ''
'strocnxT' , 2, 'Ct', 'bilinear', '', ''
'strocnyT' , 2, 'Ct', 'bilinear', '', ''
'stressp_1' , 2, 'Ct', 'bilinear', '', ''
'stressp_2' , 2, 'Ct', 'bilinear', '', ''
'stressp_3' , 2, 'Ct', 'bilinear', '', ''
'stressp_4' , 2, 'Ct', 'bilinear', '', ''
'stressm_1' , 2, 'Ct', 'bilinear', '', ''
'stressm_2' , 2, 'Ct', 'bilinear', '', ''
'stressm_3' , 2, 'Ct', 'bilinear', '', ''
'stressm_4' , 2, 'Ct', 'bilinear', '', ''
'stress12_1' , 2, 'Ct', 'bilinear', '', ''
'stress12_2' , 2, 'Ct', 'bilinear', '', ''
'stress12_3' , 2, 'Ct', 'bilinear', '', ''
'stress12_4' , 2, 'Ct', 'bilinear', '', ''
'iceumask' , 2, 'Ct', 'bilinear', '', ''
'fsnow' , 2, 'Ct', 'bilinear', '', ''
'aicen' , 3 , 'Ct', 'bilinear', '', ''
'vicen' , 3 , 'Ct', 'bilinear', '', ''
'vsnon' , 3 , 'Ct', 'bilinear', '', ''
'Tsfcn' , 3 , 'Ct', 'bilinear', '', ''
'iage' , 3 , 'Ct', 'bilinear', '', ''
'alvl' , 3 , 'Ct', 'bilinear', '', ''
'vlvl' , 3 , 'Ct', 'bilinear', '', ''
'apnd' , 3 , 'Ct', 'bilinear', '', ''
'hpnd' , 3 , 'Ct', 'bilinear', '', ''
'ipnd' , 3 , 'Ct', 'bilinear', '', ''
'dhs' , 3 , 'Ct', 'bilinear', '', ''
'ffrac' , 3 , 'Ct', 'bilinear', '', ''
'sice001' , 3 , 'Ct', 'bilinear', '', ''
'qice001' , 3 , 'Ct', 'bilinear', '', ''
'sice002' , 3 , 'Ct', 'bilinear', '', ''
'qice002' , 3 , 'Ct', 'bilinear', '', ''
'sice003' , 3 , 'Ct', 'bilinear', '', ''
'qice003' , 3 , 'Ct', 'bilinear', '', ''
'sice004' , 3 , 'Ct', 'bilinear', '', ''
'qice004' , 3 , 'Ct', 'bilinear', '', ''
'sice005' , 3 , 'Ct', 'bilinear', '', ''
'qice005' , 3 , 'Ct', 'bilinear', '', ''
'sice006' , 3 , 'Ct', 'bilinear', '', ''
'qice006' , 3 , 'Ct', 'bilinear', '', ''
'sice007' , 3 , 'Ct', 'bilinear', '', ''
'qice007' , 3 , 'Ct', 'bilinear', '', ''
'qsno001' , 3 , 'Ct', 'bilinear', '', ''
'scale_factor' , 2, 'Ct', 'bilinear', '', ''
'swvdr' , 2, 'Ct', 'bilinear', '', ''
'swvdf' , 2, 'Ct', 'bilinear', '', ''
'swidr' , 2, 'Ct', 'bilinear', '', ''
'swidf' , 2, 'Ct', 'bilinear', '', ''
'strocnxT' , 2, 'Ct', 'bilinear', '', ''
'strocnyT' , 2, 'Ct', 'bilinear', '', ''
'stressp_1' , 2, 'Ct', 'bilinear', '', ''
'stressp_2' , 2, 'Ct', 'bilinear', '', ''
'stressp_3' , 2, 'Ct', 'bilinear', '', ''
'stressp_4' , 2, 'Ct', 'bilinear', '', ''
'stressm_1' , 2, 'Ct', 'bilinear', '', ''
'stressm_2' , 2, 'Ct', 'bilinear', '', ''
'stressm_3' , 2, 'Ct', 'bilinear', '', ''
'stressm_4' , 2, 'Ct', 'bilinear', '', ''
'stress12_1' , 2, 'Ct', 'bilinear', '', ''
'stress12_2' , 2, 'Ct', 'bilinear', '', ''
'stress12_3' , 2, 'Ct', 'bilinear', '', ''
'stress12_4' , 2, 'Ct', 'bilinear', '', ''
'iceumask' , 2, 'Ct', 'bilinear', '', ''
'fsnow' , 2, 'Ct', 'bilinear', '', ''
'aicen' , 3 , 'Ct', 'bilinear', '', ''
'vicen' , 3 , 'Ct', 'bilinear', '', ''
'vsnon' , 3 , 'Ct', 'bilinear', '', ''
'Tsfcn' , 3 , 'Ct', 'bilinear', '', ''
'iage' , 3 , 'Ct', 'bilinear', '', ''
'alvl' , 3 , 'Ct', 'bilinear', '', ''
'vlvl' , 3 , 'Ct', 'bilinear', '', ''
'apnd' , 3 , 'Ct', 'bilinear', '', ''
'hpnd' , 3 , 'Ct', 'bilinear', '', ''
'ipnd' , 3 , 'Ct', 'bilinear', '', ''
'dhs' , 3 , 'Ct', 'bilinear', '', ''
'ffrac' , 3 , 'Ct', 'bilinear', '', ''
'sice001' , 3 , 'Ct', 'bilinear', '', ''
'qice001' , 3 , 'Ct', 'bilinear', '', ''
'sice002' , 3 , 'Ct', 'bilinear', '', ''
'qice002' , 3 , 'Ct', 'bilinear', '', ''
'sice003' , 3 , 'Ct', 'bilinear', '', ''
'qice003' , 3 , 'Ct', 'bilinear', '', ''
'sice004' , 3 , 'Ct', 'bilinear', '', ''
'qice004' , 3 , 'Ct', 'bilinear', '', ''
'sice005' , 3 , 'Ct', 'bilinear', '', ''
'qice005' , 3 , 'Ct', 'bilinear', '', ''
'sice006' , 3 , 'Ct', 'bilinear', '', ''
'qice006' , 3 , 'Ct', 'bilinear', '', ''
'sice007' , 3 , 'Ct', 'bilinear', '', ''
'qice007' , 3 , 'Ct', 'bilinear', '', ''
'qsno001' , 3 , 'Ct', 'bilinear', '', ''
8 changes: 8 additions & 0 deletions tests/ocnice_prep/data/invalid.dst5p00.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
&ocniceprep_nml
ftype='ocean'
wgtsdir='/scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1191124/'
griddir='/scratch1/NCEPDEV/stmp4/Denise.Worthen/CPLD_GRIDGEN/rt_1191124/'
srcdims=1440,1080
dstdims=72,35
debug=.true.
/
2 changes: 1 addition & 1 deletion tests/ocnice_prep/data/ocean.badvecgrid.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
'Salt', 3 ,'Ct' , 'bilinear' , '', ''
'h', 3 ,'Ct' , 'bilinear' , '', ''
'u', 3 ,'Cu' , 'bilinear' , 'v' , 'Cv'
'v', 3 ,'Cu' , 'bilinear' , 'u' , 'Cu'
'v', 3 ,'Cu' , 'bilinear' , 'u' , 'Cu'
2 changes: 1 addition & 1 deletion tests/ocnice_prep/data/ocean.badvecpairs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
'Salt', 3 ,'Ct' , 'bilinear' , '', ''
'u', 3 ,'Cu' , 'bilinear' , 'v' , 'Cv'
'h', 3 ,'Ct' , 'bilinear' , '', ''
'v', 3 ,'Cv' , 'bilinear' , 'u' , 'Cu'
'v', 3 ,'Cv' , 'bilinear' , 'u' , 'Cu'
6 changes: 5 additions & 1 deletion tests/ocnice_prep/ftst_program_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ program ftst_program_setup
integer :: passed, ntests
integer :: nvalid

ntests = 8
ntests = 9
passed = 0
testpath = 'tests/ocnice_prep/'

Expand All @@ -40,6 +40,10 @@ program ftst_program_setup
print *,trim(errmsg),rc
if (rc .eq. 1)passed = passed+1

call readnml(trim(testpath)//'data/invalid.dst5p00.nml',errmsg, rc)
print *,trim(errmsg),rc
if (rc .eq. 1)passed = passed+1

! test csv files
call readcsv(trim(testpath)//'data/ice.badvecpairs.csv',errmsg,rc,nvalid)
print *,trim(errmsg),rc
Expand Down

0 comments on commit f03a134

Please sign in to comment.