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

Add atm_data_version to allow JRA55 forcing filenames to have a unique version string #876

Merged
merged 14 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
31 changes: 22 additions & 9 deletions cicecore/cicedyn/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ module ice_forcing
atm_data_type, & ! 'default', 'monthly', 'ncar', 'box2001'
! 'hadgem', 'oned', 'calm', 'uniform'
! 'JRA55' or 'JRA55do'
jra55_date, & ! date of JRA55 forcing. YYYYMMDD.
bgc_data_type, & ! 'default', 'clim'
ocn_data_type, & ! 'default', 'clim', 'ncar', 'oned', 'calm', 'box2001'
! 'hadgem_sst' or 'hadgem_sst_uvocn', 'uniform'
Expand Down Expand Up @@ -2237,30 +2238,42 @@ subroutine JRA55_files(yr)
! cnt represents the possible file format options and steps thru them until one is found
exists = .false.
cnt = 1
do while (.not.exists .and. cnt <= 6)
do while (.not.exists .and. cnt <= 8)

! search for jra55 file with creation date (jra55date) in filename first
if (cnt == 1) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_'//trim(jra55_date)//'_'// &
trim(grd)//'_03hr_forcing_2005.nc'

if (cnt == 2) uwind_file = trim(atm_data_dir)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_'//trim(jra55_date)//'_'// &
trim(grd)// '_03hr_forcing_2005.nc'

! now search for files without jra55date in filename.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should ever search for file without "atm_data_date". The code will read the old files. That means we need to set atm_data_date='' in ice_in, and it needs to be set to '_20230919' for tx1.

if (cnt == 3) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_'//trim(grd)//'_03hr_forcing_2005.nc'

if (cnt == 2) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
if (cnt == 4) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_03hr_forcing_'//trim(grd)//'_2005.nc'

if (cnt == 3) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
if (cnt == 5) uwind_file = trim(atm_data_dir)//'/'//trim(atm_data_type_prefix)// &
'/8XDAILY/'//trim(atm_data_type_prefix)// '_03hr_forcing_2005.nc'

if (cnt == 4) uwind_file = trim(atm_data_dir)// &
if (cnt == 6) uwind_file = trim(atm_data_dir)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_'//trim(grd)//'_03hr_forcing_2005.nc'

if (cnt == 5) uwind_file = trim(atm_data_dir)// &
if (cnt == 7) uwind_file = trim(atm_data_dir)// &
'/8XDAILY/'//trim(atm_data_type_prefix)//'_03hr_forcing_'//trim(grd)//'_2005.nc'

if (cnt == 6) uwind_file = trim(atm_data_dir)// &
if (cnt == 8) uwind_file = trim(atm_data_dir)// &
'/8XDAILY/'//trim(atm_data_type_prefix)// '_03hr_forcing_2005.nc'


call file_year(uwind_file,yr)
INQUIRE(FILE=uwind_file,EXIST=exists)
! if (my_task == master_task) then
! write(nu_diag,*) subname,cnt,exists,trim(uwind_file)
! endif
if (my_task == master_task) then
write(nu_diag,*) subname,cnt,exists,trim(uwind_file)
apcraig marked this conversation as resolved.
Show resolved Hide resolved
endif
cnt = cnt + 1
enddo

Expand Down
9 changes: 7 additions & 2 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ subroutine input_data
use ice_forcing, only: &
ycycle, fyear_init, debug_forcing, &
atm_data_type, atm_data_dir, precip_units, rotate_wind, &
atm_data_format, ocn_data_format, &
atm_data_format, ocn_data_format, jra55_date, &
bgc_data_type, &
ocn_data_type, ocn_data_dir, wave_spec_file, &
oceanmixed_file, restore_ocn, trestore, &
Expand Down Expand Up @@ -273,7 +273,7 @@ subroutine input_data
fyear_init, ycycle, wave_spec_file,restart_coszen, &
atm_data_dir, ocn_data_dir, bgc_data_dir, &
atm_data_format, ocn_data_format, rotate_wind, &
oceanmixed_file
oceanmixed_file, jra55_date

!-----------------------------------------------------------------
! default values
Expand Down Expand Up @@ -498,6 +498,7 @@ subroutine input_data
atm_data_format = 'bin' ! file format ('bin'=binary or 'nc'=netcdf)
atm_data_type = 'default'
atm_data_dir = ' '
jra55_date = '20230919'! date jra55 forcing file was generated.
rotate_wind = .true. ! rotate wind/stress composants to computational grid orientation
calc_strair = .true. ! calculate wind stress
formdrag = .false. ! calculate form drag
Expand Down Expand Up @@ -1059,6 +1060,7 @@ subroutine input_data
call broadcast_scalar(atm_data_format, master_task)
call broadcast_scalar(atm_data_type, master_task)
call broadcast_scalar(atm_data_dir, master_task)
call broadcast_scalar(jra55_date, master_task)
call broadcast_scalar(rotate_wind, master_task)
call broadcast_scalar(calc_strair, master_task)
call broadcast_scalar(calc_Tsfc, master_task)
Expand Down Expand Up @@ -2360,6 +2362,9 @@ subroutine input_data
write(nu_diag,1021) ' fyear_init = ', fyear_init
write(nu_diag,1021) ' ycycle = ', ycycle
write(nu_diag,1031) ' atm_data_type = ', trim(atm_data_type)
if (index(trim(atm_data_type),'JRA55') /= 0) then
write(nu_diag,1031) ' jra55_date = ', trim(jra55_date)
endif
if (trim(atm_data_type) /= 'default') then
write(nu_diag,1031) ' atm_data_dir = ', trim(atm_data_dir)
write(nu_diag,1031) ' precip_units = ', trim(precip_units)
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
precip_units = 'mm_per_month'
default_season = 'winter'
atm_data_type = 'ncar'
jra55_date = ''
ocn_data_type = 'default'
bgc_data_type = 'default'
fe_data_type = 'default'
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.jra55
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
atm_data_format = 'nc'
atm_data_type = 'JRA55'
daveh150 marked this conversation as resolved.
Show resolved Hide resolved
jra55_date = '20230919'
Loading