From c2c91f363808ce8ce1a126940cc694c143b208d8 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Tue, 23 May 2023 16:59:58 -0500 Subject: [PATCH 01/13] updating paths for local nrlssc builds --- configuration/scripts/machines/env.nrlssc_gnu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration/scripts/machines/env.nrlssc_gnu b/configuration/scripts/machines/env.nrlssc_gnu index 1f8dd4441..338727348 100644 --- a/configuration/scripts/machines/env.nrlssc_gnu +++ b/configuration/scripts/machines/env.nrlssc_gnu @@ -5,9 +5,9 @@ setenv ICE_MACHINE_MACHINFO "nrlssc" setenv ICE_MACHINE_ENVNAME gnu setenv ICE_MACHINE_ENVINFO "gnu" setenv ICE_MACHINE_MAKE gmake -setenv ICE_MACHINE_WKDIR /u/data/hebert/CICE_RUNS -setenv ICE_MACHINE_INPUTDATA /u/data/hebert/CICE_RUNS -setenv ICE_MACHINE_BASELINE /u/data/hebert/CICE_BASELINE +setenv ICE_MACHINE_WKDIR /u/hebert/data/CICE_RUNS +setenv ICE_MACHINE_INPUTDATA /u/hebert/data/CICE_RUNS +setenv ICE_MACHINE_BASELINE /u/hebert/data/CICE_BASELINE setenv ICE_MACHINE_SUBMIT "qsub " setenv ICE_MACHINE_ACCT P00000000 setenv ICE_MACHINE_QUEUE "standard" From 87b7fabc55257c4ccccad71edca2743486cdbbe1 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Tue, 23 May 2023 17:00:24 -0500 Subject: [PATCH 02/13] Add jra55do forcing option --- cicecore/cicedyn/general/ice_forcing.F90 | 482 ++++++++++++++++++++++- 1 file changed, 476 insertions(+), 6 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 541efb282..4850497ab 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -281,11 +281,14 @@ subroutine init_forcing_atmo file=__FILE__, line=__LINE__) endif - if (use_leap_years .and. (trim(atm_data_type) /= 'JRA55_gx1' .and. & - trim(atm_data_type) /= 'JRA55_gx3' .and. & - trim(atm_data_type) /= 'JRA55_tx1' .and. & - trim(atm_data_type) /= 'hycom' .and. & - trim(atm_data_type) /= 'box2001')) then + if (use_leap_years .and. (trim(atm_data_type) /= 'JRA55_gx1' .and. & + trim(atm_data_type) /= 'JRA55_gx3' .and. & + trim(atm_data_type) /= 'JRA55_tx1' .and. & + trim(atm_data_type) /= 'JRA55do_gx1' .and. & + trim(atm_data_type) /= 'JRA55do_gx3' .and. & + trim(atm_data_type) /= 'JRA55do_tx1' .and. & + trim(atm_data_type) /= 'hycom' .and. & + trim(atm_data_type) /= 'box2001')) then write(nu_diag,*) 'use_leap_years option is currently only supported for' write(nu_diag,*) 'JRA55, default , and box2001 atmospheric data' call abort_ice(error_message=subname, file=__FILE__, line=__LINE__) @@ -308,6 +311,12 @@ subroutine init_forcing_atmo call JRA55_gx3_files(fyear) elseif (trim(atm_data_type) == 'JRA55_tx1') then call JRA55_tx1_files(fyear) + elseif (trim(atm_data_type) == 'JRA55do_gx1') then + call JRA55do_gx1_files(fyear) + elseif (trim(atm_data_type) == 'JRA55do_gx3') then + call JRA55do_gx3_files(fyear) + elseif (trim(atm_data_type) == 'JRA55do_tx1') then + call JRA55do_tx1_files(fyear) elseif (trim(atm_data_type) == 'hadgem') then call hadgem_files(fyear) elseif (trim(atm_data_type) == 'monthly') then @@ -654,6 +663,12 @@ subroutine get_forcing_atmo call JRA55_data elseif (trim(atm_data_type) == 'JRA55_tx1') then call JRA55_data + elseif (trim(atm_data_type) == 'JRA55do_gx1') then + call JRA55do_data + elseif (trim(atm_data_type) == 'JRA55do_gx3') then + call JRA55do_data + elseif (trim(atm_data_type) == 'JRA55do_tx1') then + call JRA55do_data elseif (trim(atm_data_type) == 'hadgem') then call hadgem_data elseif (trim(atm_data_type) == 'monthly') then @@ -1605,6 +1620,18 @@ subroutine file_year (data_file, yr) i = index(data_file,'.nc') - 5 tmpname = data_file write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' + elseif (trim(atm_data_type) == 'JRA55do_gx1') then ! netcdf + i = index(data_file,'.nc') - 5 + tmpname = data_file + write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' + elseif (trim(atm_data_type) == 'JRA55do_gx3') then ! netcdf + i = index(data_file,'.nc') - 5 + tmpname = data_file + write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' + elseif (trim(atm_data_type) == 'JRA55do_tx1') then ! netcdf + i = index(data_file,'.nc') - 5 + tmpname = data_file + write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' else ! LANL/NCAR naming convention i = index(data_file,'.dat') - 5 tmpname = data_file @@ -2314,8 +2341,173 @@ subroutine JRA55_gx3_files(yr) write (nu_diag,*) 'Atmospheric data files:' write (nu_diag,*) trim(uwind_file) endif - end subroutine JRA55_gx3_files + end subroutine JRA55_gx3_files + +!======================================================================= + subroutine JRA55do_gx1_files(yr) +! + integer (kind=int_kind), intent(in) :: & + yr ! current forcing year + + character(len=*), parameter :: subname = '(JRA55do_gx1_files)' + + if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + + uwind_file = & + trim(atm_data_dir)//'/8XDAILY/uas_gx1_2005.nc' + call file_year(uwind_file,yr) + + vwind_file = & + trim(atm_data_dir)//'/8XDAILY/vas_gx1_2005.nc' + call file_year(vwind_file,yr) + + tair_file = & + trim(atm_data_dir)//'/8XDAILY/tas_gx1_2005.nc' + call file_year(tair_file,yr) + + humid_file = & + trim(atm_data_dir)//'/8XDAILY/huss_gx1_2005.nc' + call file_year(humid_file,yr) + + rain_file = & + trim(atm_data_dir)//'/8XDAILY/ttlpcp_gx1_2005.nc' + call file_year(rain_file,yr) + + fsw_file = & + trim(atm_data_dir)//'/8XDAILY/rsds_gx1_2005.nc' + call file_year(fsw_file,yr) + + flw_file = & + trim(atm_data_dir)//'/8XDAILY/rlds_gx1_2005.nc' + call file_year(flw_file,yr) + + + if (my_task == master_task) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'Atmospheric data files:' + write (nu_diag,*) trim(uwind_file) + write (nu_diag,*) trim(vwind_file) + write (nu_diag,*) trim(tair_file) + write (nu_diag,*) trim(humid_file) + write (nu_diag,*) trim(rain_file) + write (nu_diag,*) trim(fsw_file) + write (nu_diag,*) trim(flw_file) + endif + + end subroutine JRA55do_gx1_files + +!======================================================================= + + subroutine JRA55do_tx1_files(yr) +! + integer (kind=int_kind), intent(in) :: & + yr ! current forcing year + + character(len=*), parameter :: subname = '(JRA55do_tx1_files)' + + if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + + uwind_file = & + trim(atm_data_dir)//'/8XDAILY/uas_tx1_2005.nc' + call file_year(uwind_file,yr) + + vwind_file = & + trim(atm_data_dir)//'/8XDAILY/vas_tx1_2005.nc' + call file_year(vwind_file,yr) + + tair_file = & + trim(atm_data_dir)//'/8XDAILY/tas_tx1_2005.nc' + call file_year(tair_file,yr) + + humid_file = & + trim(atm_data_dir)//'/8XDAILY/huss_tx1_2005.nc' + call file_year(humid_file,yr) + + rain_file = & + trim(atm_data_dir)//'/8XDAILY/ttlpcp_tx1_2005.nc' + call file_year(rain_file,yr) + + fsw_file = & + trim(atm_data_dir)//'/8XDAILY/rsds_tx1_2005.nc' + call file_year(fsw_file,yr) + + flw_file = & + trim(atm_data_dir)//'/8XDAILY/rlds_tx1_2005.nc' + call file_year(flw_file,yr) + + + if (my_task == master_task) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'Atmospheric data files:' + write (nu_diag,*) trim(uwind_file) + write (nu_diag,*) trim(vwind_file) + write (nu_diag,*) trim(tair_file) + write (nu_diag,*) trim(humid_file) + write (nu_diag,*) trim(rain_file) + write (nu_diag,*) trim(fsw_file) + write (nu_diag,*) trim(flw_file) + endif + + end subroutine JRA55do_tx1_files + +!======================================================================= + + subroutine JRA55do_gx3_files(yr) +! + integer (kind=int_kind), intent(in) :: & + yr ! current forcing year + + character(len=*), parameter :: subname = '(JRA55do_gx3_files)' + + if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + + uwind_file = & + trim(atm_data_dir)//'/8XDAILY/uas_gx3_2005.nc' + call file_year(uwind_file,yr) + + vwind_file = & + trim(atm_data_dir)//'/8XDAILY/vas_gx3_2005.nc' + call file_year(vwind_file,yr) + + tair_file = & + trim(atm_data_dir)//'/8XDAILY/tas_gx3_2005.nc' + call file_year(tair_file,yr) + + humid_file = & + trim(atm_data_dir)//'/8XDAILY/huss_gx3_2005.nc' + call file_year(humid_file,yr) + + rain_file = & + trim(atm_data_dir)//'/8XDAILY/ttlpcp_gx3_2005.nc' + call file_year(rain_file,yr) + + fsw_file = & + trim(atm_data_dir)//'/8XDAILY/rsds_gx3_2005.nc' + call file_year(fsw_file,yr) + + flw_file = & + trim(atm_data_dir)//'/8XDAILY/rlds_gx3_2005.nc' + call file_year(flw_file,yr) + + + if (my_task == master_task) then + write (nu_diag,*) ' ' + write (nu_diag,*) 'Atmospheric data files:' + write (nu_diag,*) trim(uwind_file) + write (nu_diag,*) trim(vwind_file) + write (nu_diag,*) trim(tair_file) + write (nu_diag,*) trim(humid_file) + write (nu_diag,*) trim(rain_file) + write (nu_diag,*) trim(fsw_file) + write (nu_diag,*) trim(flw_file) + endif + + end subroutine JRA55do_gx3_files + +!======================================================================= + + #ifdef UNDEPRECATE_LYq !======================================================================= ! @@ -2791,6 +2983,284 @@ subroutine JRA55_data end subroutine JRA55_data !======================================================================= + + subroutine JRA55do_data + + use ice_blocks, only: block, get_block + use ice_global_reductions, only: global_minval, global_maxval + use ice_domain, only: nblocks, distrb_info + use ice_flux, only: fsnow, Tair, uatm, vatm, Qa, fsw, flw + use ice_grid, only: hm, tmask, umask + use ice_state, only: aice + use ice_calendar, only: days_per_year + + integer (kind=int_kind) :: & + ncid , & ! netcdf file id + i, j, n1 , & + lfyear , & ! local year value + recnum , & ! record number + maxrec , & ! maximum record number + iblk ! block index + + integer (kind=int_kind), save :: & + frec_info(2,2) = -99 ! remember prior values to reduce reading + ! first dim is yr, recnum + ! second dim is data1 data2 + + real (kind=dbl_kind) :: & + sec3hr , & ! number of seconds in 3 hours + secday , & ! number of seconds in day + eps, tt , & ! for interpolation coefficients + Tffresh , & + vmin, vmax + + character(len=64) :: fieldname !netcdf field name + + character(len=*), parameter :: subname = '(JRA55do_data)' + + if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + + call icepack_query_parameters(Tffresh_out=Tffresh) + call icepack_query_parameters(secday_out=secday) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + + sec3hr = secday/c8 ! seconds in 3 hours + maxrec = days_per_year * 8 + + if (local_debug .and. my_task == master_task) then + write(nu_diag,*) subname,'fdbg dpy, maxrec = ',days_per_year,maxrec + endif + + !------------------------------------------------------------------- + ! 3-hourly data. + ! states are instantaneous, 1st record is 00z Jan 1 + ! fluxes are 3 hour averages, 1st record is 00z-03z Jan 1 + ! interpolate states, do not interpolate fluxes + !------------------------------------------------------------------- + ! Individual NETCDF files for each quantity. + ! winds in NORTH and EAST direction (not rotated) + ! file variable names are: + ! rsds (shortwave W/m^2), 3 hr average + ! rlds (longwave W/m^2), 3 hr average + ! ttlpcp (precipitation kg/m s-1), 3 hr average + ! uas (eastward wind m/s), instantaneous + ! vas (northward wind m/s), instantaneous + ! tas (air temperature K), instantaneous + ! huss (specific humidity kg/kg), instantaneous + !------------------------------------------------------------------- + + do n1 = 1, 2 + + lfyear = fyear + if (n1 == 1) then + recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) + call file_year(tair_file, lfyear) ! make file name with proper year + call file_year(uwind_file, lfyear) ! make file name with proper year + call file_year(vwind_file, lfyear) ! make file name with proper year + call file_year(humid_file, lfyear) ! make file name with proper year + call file_year(fsw_file, lfyear) ! make file name with proper year + call file_year(flw_file, lfyear) ! make file name with proper year + call file_year(rain_file, lfyear) ! make file name with proper year + + if (my_task == master_task .and. (recnum <= 2 .or. recnum >= maxrec-1)) then + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(tair_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(uwind_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(vwind_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(humid_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(fsw_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(flw_file) + write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(rain_file) + endif + elseif (n1 == 2) then + recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) + 1 + if (recnum > maxrec) then + lfyear = fyear + 1 ! next year + if (lfyear > fyear_final) lfyear = fyear_init + recnum = 1 + call file_year(tair_file, lfyear) ! make file name with proper year + call file_year(uwind_file, lfyear) ! make file name with proper year + call file_year(vwind_file, lfyear) ! make file name with proper year + call file_year(humid_file, lfyear) ! make file name with proper year + call file_year(fsw_file, lfyear) ! make file name with proper year + call file_year(flw_file, lfyear) ! make file name with proper year + call file_year(rain_file, lfyear) ! make file name with proper year + + if (my_task == master_task) then + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(tair_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(uwind_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(vwind_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(humid_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(fsw_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(flw_file) + write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(rain_file) + endif + endif + endif + + if (local_debug .and. my_task == master_task) then + write(nu_diag,*) subname,'fdbg read recnum = ',recnum,n1 + endif + + ! to reduce reading, check whether it's the same data as last read + + if (lfyear /= frec_info(1,n1) .or. recnum /= frec_info(2,n1)) then + + ! check whether we can copy values from 2 to 1, should be faster than reading + ! can only do this from 2 to 1 or 1 to 2 without setting up a temporary + ! it's more likely that the values from data2 when time advances are needed in data1 + ! compare n1=1 year/record with data from last timestep at n1=2 + + if (n1 == 1 .and. lfyear == frec_info(1,2) .and. recnum == frec_info(2,2)) then + Tair_data(:,:,1,:) = Tair_data(:,:,2,:) + uatm_data(:,:,1,:) = uatm_data(:,:,2,:) + vatm_data(:,:,1,:) = vatm_data(:,:,2,:) + Qa_data(:,:,1,:) = Qa_data(:,:,2,:) + fsw_data(:,:,1,:) = fsw_data(:,:,2,:) + flw_data(:,:,1,:) = flw_data(:,:,2,:) + fsnow_data(:,:,1,:) = fsnow_data(:,:,2,:) + else + + ! read each variable from individual NetCDFs + fieldname = 'tas' + call ice_open_nc(tair_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,Tair_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'uas' + call ice_open_nc(uwind_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,uatm_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'vas' + call ice_open_nc(vwind_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,vatm_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'huss' + call ice_open_nc(humid_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,Qa_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'rsds' + call ice_open_nc(fsw_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,fsw_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'rlds' + call ice_open_nc(flw_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,flw_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + fieldname = 'ttlpcp' + call ice_open_nc(rain_file,ncid) + call ice_read_nc(ncid,recnum,fieldname,fsnow_data(:,:,n1,:),local_debug, & + field_loc=field_loc_center, & + field_type=field_type_scalar) + call ice_close_nc(ncid) + + endif ! copy data from n1=2 from last timestep to n1=1 + endif ! input data is same as last timestep + + frec_info(1,n1) = lfyear + frec_info(2,n1) = recnum + + enddo ! n1 + + ! Compute interpolation coefficients + eps = 1.0e-6 + tt = real(mod(msec,nint(sec3hr)),kind=dbl_kind) + c2intp = tt / sec3hr + if (c2intp < c0 .and. c2intp > c0-eps) c2intp = c0 + if (c2intp > c1 .and. c2intp < c1+eps) c2intp = c1 + c1intp = 1.0_dbl_kind - c2intp + if (c2intp < c0 .or. c2intp > c1) then + write(nu_diag,*) subname,' ERROR: c2intp = ',c2intp + call abort_ice (error_message=subname//' ERROR: c2intp out of range', & + file=__FILE__, line=__LINE__) + endif + if (local_debug .and. my_task == master_task) then + write(nu_diag,*) subname,'fdbg c12intp = ',c1intp,c2intp + endif + + ! Interpolate + call interpolate_data (Tair_data, Tair) + call interpolate_data (uatm_data, uatm) + call interpolate_data (vatm_data, vatm) + call interpolate_data (Qa_data, Qa) + ! use 3 hr average for heat flux and precip fields, no interpolation + ! call interpolate_data (fsw_data, fsw) + ! call interpolate_data (flw_data, flw) + ! call interpolate_data (fsnow_data, fsnow) + fsw(:,:,:) = fsw_data(:,:,1,:) + flw(:,:,:) = flw_data(:,:,1,:) + fsnow(:,:,:) = fsnow_data(:,:,1,:) + + !$OMP PARALLEL DO PRIVATE(iblk,i,j) + do iblk = 1, nblocks + ! limit summer Tair values where ice is present + do j = 1, ny_block + do i = 1, nx_block + if (aice(i,j,iblk) > p1) Tair(i,j,iblk) = min(Tair(i,j,iblk), Tffresh+p1) + enddo + enddo + + do j = 1, ny_block + do i = 1, nx_block + Qa (i,j,iblk) = Qa (i,j,iblk) * hm(i,j,iblk) + Tair(i,j,iblk) = Tair(i,j,iblk) * hm(i,j,iblk) + uatm(i,j,iblk) = uatm(i,j,iblk) * hm(i,j,iblk) + vatm(i,j,iblk) = vatm(i,j,iblk) * hm(i,j,iblk) + fsw (i,j,iblk) = fsw (i,j,iblk) * hm(i,j,iblk) + flw (i,j,iblk) = flw (i,j,iblk) * hm(i,j,iblk) + fsnow(i,j,iblk) = fsnow (i,j,iblk) * hm(i,j,iblk) + enddo + enddo + + enddo ! iblk + !$OMP END PARALLEL DO + + if (debug_forcing .or. local_debug) then + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg JRA55do_data' + vmin = global_minval(fsw,distrb_info,tmask) + vmax = global_maxval(fsw,distrb_info,tmask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg fsw',vmin,vmax + vmin = global_minval(flw,distrb_info,tmask) + vmax = global_maxval(flw,distrb_info,tmask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg flw',vmin,vmax + vmin =global_minval(fsnow,distrb_info,tmask) + vmax =global_maxval(fsnow,distrb_info,tmask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg fsnow',vmin,vmax + vmin = global_minval(Tair,distrb_info,tmask) + vmax = global_maxval(Tair,distrb_info,tmask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg Tair',vmin,vmax + vmin = global_minval(uatm,distrb_info,umask) + vmax = global_maxval(uatm,distrb_info,umask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg uatm',vmin,vmax + vmin = global_minval(vatm,distrb_info,umask) + vmax = global_maxval(vatm,distrb_info,umask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg vatm',vmin,vmax + vmin = global_minval(Qa,distrb_info,tmask) + vmax = global_maxval(Qa,distrb_info,tmask) + if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg Qa',vmin,vmax + endif ! debug_forcing + + end subroutine JRA55do_data + +! ================================================================= ! ! AOMIP shortwave forcing ! standard calculation using solar declination angle From fab42150ad9be90b8cd65eaa14e8970c5fa3e418 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Thu, 25 May 2023 17:52:37 +0000 Subject: [PATCH 03/13] Updated env.nrlssc_gnu for new local directory structure --- configuration/scripts/machines/env.nrlssc_gnu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configuration/scripts/machines/env.nrlssc_gnu b/configuration/scripts/machines/env.nrlssc_gnu index 338727348..94025ddf9 100644 --- a/configuration/scripts/machines/env.nrlssc_gnu +++ b/configuration/scripts/machines/env.nrlssc_gnu @@ -6,11 +6,11 @@ setenv ICE_MACHINE_ENVNAME gnu setenv ICE_MACHINE_ENVINFO "gnu" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR /u/hebert/data/CICE_RUNS -setenv ICE_MACHINE_INPUTDATA /u/hebert/data/CICE_RUNS +setenv ICE_MACHINE_INPUTDATA /u/hebert/data/ setenv ICE_MACHINE_BASELINE /u/hebert/data/CICE_BASELINE setenv ICE_MACHINE_SUBMIT "qsub " setenv ICE_MACHINE_ACCT P00000000 setenv ICE_MACHINE_QUEUE "standard" -setenv ICE_MACHINE_TPNODE 20 # tasks per node -setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_TPNODE 28 # tasks per node +setenv ICE_MACHINE_BLDTHRDS 8 setenv ICE_MACHINE_QSTAT "qstat " From 367f8b3a796079912c15492a2a122a717fb27d0d Mon Sep 17 00:00:00 2001 From: daveh150 Date: Thu, 25 May 2023 15:16:18 -0500 Subject: [PATCH 04/13] Added JRA55do to file names. Added comments for each variable name at top of JRA55do_???_files subroutine --- cicecore/cicedyn/general/ice_forcing.F90 | 84 +++++++++++++++++------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 4850497ab..aebea1016 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -2347,6 +2347,19 @@ end subroutine JRA55_gx3_files !======================================================================= subroutine JRA55do_gx1_files(yr) ! + !------------------------------------------------------------------- + ! Individual NETCDF files for each quantity. + ! winds in NORTH and EAST direction (not rotated) + ! file variable names are: + ! rsds (shortwave W/m^2), 3 hr average + ! rlds (longwave W/m^2), 3 hr average + ! ttlpcp (precipitation kg/m s-1), 3 hr average + ! uas (eastward wind m/s), instantaneous + ! vas (northward wind m/s), instantaneous + ! tas (air temperature K), instantaneous + ! huss (specific humidity kg/kg), instantaneous + !------------------------------------------------------------------- + integer (kind=int_kind), intent(in) :: & yr ! current forcing year @@ -2355,31 +2368,31 @@ subroutine JRA55do_gx1_files(yr) if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' uwind_file = & - trim(atm_data_dir)//'/8XDAILY/uas_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_gx1_2005.nc' call file_year(uwind_file,yr) vwind_file = & - trim(atm_data_dir)//'/8XDAILY/vas_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_gx1_2005.nc' call file_year(vwind_file,yr) tair_file = & - trim(atm_data_dir)//'/8XDAILY/tas_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_gx1_2005.nc' call file_year(tair_file,yr) humid_file = & - trim(atm_data_dir)//'/8XDAILY/huss_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_gx1_2005.nc' call file_year(humid_file,yr) rain_file = & - trim(atm_data_dir)//'/8XDAILY/ttlpcp_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_gx1_2005.nc' call file_year(rain_file,yr) fsw_file = & - trim(atm_data_dir)//'/8XDAILY/rsds_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_gx1_2005.nc' call file_year(fsw_file,yr) flw_file = & - trim(atm_data_dir)//'/8XDAILY/rlds_gx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_gx1_2005.nc' call file_year(flw_file,yr) @@ -2401,6 +2414,20 @@ end subroutine JRA55do_gx1_files subroutine JRA55do_tx1_files(yr) ! + + !------------------------------------------------------------------- + ! Individual NETCDF files for each quantity. + ! winds in NORTH and EAST direction (not rotated) + ! file variable names are: + ! rsds (shortwave W/m^2), 3 hr average + ! rlds (longwave W/m^2), 3 hr average + ! ttlpcp (precipitation kg/m s-1), 3 hr average + ! uas (eastward wind m/s), instantaneous + ! vas (northward wind m/s), instantaneous + ! tas (air temperature K), instantaneous + ! huss (specific humidity kg/kg), instantaneous + !------------------------------------------------------------------- + integer (kind=int_kind), intent(in) :: & yr ! current forcing year @@ -2409,31 +2436,31 @@ subroutine JRA55do_tx1_files(yr) if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' uwind_file = & - trim(atm_data_dir)//'/8XDAILY/uas_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_tx1_2005.nc' call file_year(uwind_file,yr) vwind_file = & - trim(atm_data_dir)//'/8XDAILY/vas_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_tx1_2005.nc' call file_year(vwind_file,yr) tair_file = & - trim(atm_data_dir)//'/8XDAILY/tas_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_tx1_2005.nc' call file_year(tair_file,yr) humid_file = & - trim(atm_data_dir)//'/8XDAILY/huss_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_tx1_2005.nc' call file_year(humid_file,yr) rain_file = & - trim(atm_data_dir)//'/8XDAILY/ttlpcp_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_tx1_2005.nc' call file_year(rain_file,yr) fsw_file = & - trim(atm_data_dir)//'/8XDAILY/rsds_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_tx1_2005.nc' call file_year(fsw_file,yr) flw_file = & - trim(atm_data_dir)//'/8XDAILY/rlds_tx1_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_tx1_2005.nc' call file_year(flw_file,yr) @@ -2454,7 +2481,20 @@ end subroutine JRA55do_tx1_files !======================================================================= subroutine JRA55do_gx3_files(yr) -! + + !------------------------------------------------------------------- + ! Individual NETCDF files for each quantity. + ! winds in NORTH and EAST direction (not rotated) + ! file variable names are: + ! rsds (shortwave W/m^2), 3 hr average + ! rlds (longwave W/m^2), 3 hr average + ! ttlpcp (precipitation kg/m s-1), 3 hr average + ! uas (eastward wind m/s), instantaneous + ! vas (northward wind m/s), instantaneous + ! tas (air temperature K), instantaneous + ! huss (specific humidity kg/kg), instantaneous + !------------------------------------------------------------------- + integer (kind=int_kind), intent(in) :: & yr ! current forcing year @@ -2463,31 +2503,31 @@ subroutine JRA55do_gx3_files(yr) if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' uwind_file = & - trim(atm_data_dir)//'/8XDAILY/uas_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_gx3_2005.nc' call file_year(uwind_file,yr) vwind_file = & - trim(atm_data_dir)//'/8XDAILY/vas_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_gx3_2005.nc' call file_year(vwind_file,yr) tair_file = & - trim(atm_data_dir)//'/8XDAILY/tas_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_gx3_2005.nc' call file_year(tair_file,yr) humid_file = & - trim(atm_data_dir)//'/8XDAILY/huss_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_gx3_2005.nc' call file_year(humid_file,yr) rain_file = & - trim(atm_data_dir)//'/8XDAILY/ttlpcp_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_gx3_2005.nc' call file_year(rain_file,yr) fsw_file = & - trim(atm_data_dir)//'/8XDAILY/rsds_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_gx3_2005.nc' call file_year(fsw_file,yr) flw_file = & - trim(atm_data_dir)//'/8XDAILY/rlds_gx3_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_gx3_2005.nc' call file_year(flw_file,yr) From 49fede094d405297538ec66167f081d5d9b3547d Mon Sep 17 00:00:00 2001 From: daveh150 Date: Thu, 1 Jun 2023 16:28:00 -0500 Subject: [PATCH 05/13] Make JRA55 forcing to use common subroutines. Search atm_data_type for specific cases --- cicecore/cicedyn/general/ice_forcing.F90 | 606 ++--------------------- 1 file changed, 39 insertions(+), 567 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index aebea1016..911a1b8a2 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -305,18 +305,13 @@ subroutine init_forcing_atmo elseif (trim(atm_data_type) == 'LYq') then call LY_files(fyear) #endif - elseif (trim(atm_data_type) == 'JRA55_gx1') then - call JRA55_gx1_files(fyear) - elseif (trim(atm_data_type) == 'JRA55_gx3') then - call JRA55_gx3_files(fyear) - elseif (trim(atm_data_type) == 'JRA55_tx1') then - call JRA55_tx1_files(fyear) - elseif (trim(atm_data_type) == 'JRA55do_gx1') then - call JRA55do_gx1_files(fyear) - elseif (trim(atm_data_type) == 'JRA55do_gx3') then - call JRA55do_gx3_files(fyear) - elseif (trim(atm_data_type) == 'JRA55do_tx1') then - call JRA55do_tx1_files(fyear) + elseif ((trim(atm_data_type) == 'JRA55_gx1') .or. & + (trim(atm_data_type) == 'JRA55_gx3') .or. & + (trim(atm_data_type) == 'JRA55_tx1') .or. & + (trim(atm_data_type) == 'JRA55do_gx1') .or. & + (trim(atm_data_type) == 'JRA55do_gx3') .or. & + (trim(atm_data_type) == 'JRA55do_tx1')) then + call JRA55_files(fyear) elseif (trim(atm_data_type) == 'hadgem') then call hadgem_files(fyear) elseif (trim(atm_data_type) == 'monthly') then @@ -657,18 +652,13 @@ subroutine get_forcing_atmo elseif (trim(atm_data_type) == 'LYq') then call LY_data #endif - elseif (trim(atm_data_type) == 'JRA55_gx1') then + elseif ((trim(atm_data_type) == 'JRA55_gx1') .or. & + (trim(atm_data_type) == 'JRA55_gx3') .or. & + (trim(atm_data_type) == 'JRA55_tx1') .or. & + (trim(atm_data_type) == 'JRA55do_gx1') .or. & + (trim(atm_data_type) == 'JRA55do_gx3') .or. & + (trim(atm_data_type) == 'JRA55do_tx1')) then call JRA55_data - elseif (trim(atm_data_type) == 'JRA55_gx3') then - call JRA55_data - elseif (trim(atm_data_type) == 'JRA55_tx1') then - call JRA55_data - elseif (trim(atm_data_type) == 'JRA55do_gx1') then - call JRA55do_data - elseif (trim(atm_data_type) == 'JRA55do_gx3') then - call JRA55do_data - elseif (trim(atm_data_type) == 'JRA55do_tx1') then - call JRA55do_data elseif (trim(atm_data_type) == 'hadgem') then call hadgem_data elseif (trim(atm_data_type) == 'monthly') then @@ -1608,27 +1598,7 @@ subroutine file_year (data_file, yr) i = index(data_file,'.nc') - 5 tmpname = data_file write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55_gx1') then ! netcdf - i = index(data_file,'.nc') - 5 - tmpname = data_file - write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55_gx3') then ! netcdf - i = index(data_file,'.nc') - 5 - tmpname = data_file - write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55_tx1') then ! netcdf - i = index(data_file,'.nc') - 5 - tmpname = data_file - write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55do_gx1') then ! netcdf - i = index(data_file,'.nc') - 5 - tmpname = data_file - write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55do_gx3') then ! netcdf - i = index(data_file,'.nc') - 5 - tmpname = data_file - write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' - elseif (trim(atm_data_type) == 'JRA55do_tx1') then ! netcdf + elseif (index(trim(atm_data_type),'JRA55') > 0) then ! netcdf i = index(data_file,'.nc') - 5 tmpname = data_file write(data_file,'(a,i4.4,a)') tmpname(1:i), yr, '.nc' @@ -2282,272 +2252,52 @@ end subroutine LY_files #endif !======================================================================= - subroutine JRA55_gx1_files(yr) -! - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year - - character(len=*), parameter :: subname = '(JRA55_gx1_files)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55_03hr_forcing_2005.nc' - call file_year(uwind_file,yr) - if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) - endif - end subroutine JRA55_gx1_files - -!======================================================================= - - subroutine JRA55_tx1_files(yr) -! - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year - - character(len=*), parameter :: subname = '(JRA55_tx1_files)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55_03hr_forcing_tx1_2005.nc' - call file_year(uwind_file,yr) - if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) - endif - end subroutine JRA55_tx1_files - -!======================================================================= - - subroutine JRA55_gx3_files(yr) + subroutine JRA55_files(yr) ! integer (kind=int_kind), intent(in) :: & yr ! current forcing year - character(len=*), parameter :: subname = '(JRA55_gx3_files)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55_gx3_03hr_forcing_2005.nc' - call file_year(uwind_file,yr) - if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) - endif - - end subroutine JRA55_gx3_files - -!======================================================================= - subroutine JRA55do_gx1_files(yr) -! - !------------------------------------------------------------------- - ! Individual NETCDF files for each quantity. - ! winds in NORTH and EAST direction (not rotated) - ! file variable names are: - ! rsds (shortwave W/m^2), 3 hr average - ! rlds (longwave W/m^2), 3 hr average - ! ttlpcp (precipitation kg/m s-1), 3 hr average - ! uas (eastward wind m/s), instantaneous - ! vas (northward wind m/s), instantaneous - ! tas (air temperature K), instantaneous - ! huss (specific humidity kg/kg), instantaneous - !------------------------------------------------------------------- - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year - - character(len=*), parameter :: subname = '(JRA55do_gx1_files)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_gx1_2005.nc' - call file_year(uwind_file,yr) - - vwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_gx1_2005.nc' - call file_year(vwind_file,yr) - - tair_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_gx1_2005.nc' - call file_year(tair_file,yr) - - humid_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_gx1_2005.nc' - call file_year(humid_file,yr) - - rain_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_gx1_2005.nc' - call file_year(rain_file,yr) - - fsw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_gx1_2005.nc' - call file_year(fsw_file,yr) + ! local variables + integer (kind=int_kind) :: & + i ! used to check for substring - flw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_gx1_2005.nc' - call file_year(flw_file,yr) - + character(len=3) :: & + grd ! gx3, gx1, tx1 - if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) - write (nu_diag,*) trim(vwind_file) - write (nu_diag,*) trim(tair_file) - write (nu_diag,*) trim(humid_file) - write (nu_diag,*) trim(rain_file) - write (nu_diag,*) trim(fsw_file) - write (nu_diag,*) trim(flw_file) - endif - - end subroutine JRA55do_gx1_files - -!======================================================================= - - subroutine JRA55do_tx1_files(yr) -! - - !------------------------------------------------------------------- - ! Individual NETCDF files for each quantity. - ! winds in NORTH and EAST direction (not rotated) - ! file variable names are: - ! rsds (shortwave W/m^2), 3 hr average - ! rlds (longwave W/m^2), 3 hr average - ! ttlpcp (precipitation kg/m s-1), 3 hr average - ! uas (eastward wind m/s), instantaneous - ! vas (northward wind m/s), instantaneous - ! tas (air temperature K), instantaneous - ! huss (specific humidity kg/kg), instantaneous - !------------------------------------------------------------------- - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year - - character(len=*), parameter :: subname = '(JRA55do_tx1_files)' + character(len=*), parameter :: subname = '(JRA55_files)' if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_tx1_2005.nc' - call file_year(uwind_file,yr) - - vwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_tx1_2005.nc' - call file_year(vwind_file,yr) - - tair_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_tx1_2005.nc' - call file_year(tair_file,yr) - - humid_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_tx1_2005.nc' - call file_year(humid_file,yr) - - rain_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_tx1_2005.nc' - call file_year(rain_file,yr) - - fsw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_tx1_2005.nc' - call file_year(fsw_file,yr) - - flw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_tx1_2005.nc' - call file_year(flw_file,yr) - + ! check for grid version using fortran INDEX intrinsic + if (index(trim(atm_data_type),'gx1') > 0) then + grd = 'gx1' + else if (index(trim(atm_data_type),'gx3') > 0) then + grd = 'gx3' + else if (index(trim(atm_data_type),'tx1') > 0) then + grd = 'tx1' + else + call abort_ice(error_message=subname//' unknown grid type') + endif - if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) - write (nu_diag,*) trim(vwind_file) - write (nu_diag,*) trim(tair_file) - write (nu_diag,*) trim(humid_file) - write (nu_diag,*) trim(rain_file) - write (nu_diag,*) trim(fsw_file) - write (nu_diag,*) trim(flw_file) + ! check if JRA55 or JRA55do + if (index(trim(atm_data_type),'JRA55do') > 0) then + uwind_file = & + trim(atm_data_dir)//'/8XDAILY/JRA55do_03hr_forcing_'//grd//'_2005.nc' + else ! assumes only other option os JRA55 + uwind_file = & + trim(atm_data_dir)//'/8XDAILY/JRA55_03hr_forcing_'//grd//'_2005.nc' endif - - end subroutine JRA55do_tx1_files - -!======================================================================= - - subroutine JRA55do_gx3_files(yr) - !------------------------------------------------------------------- - ! Individual NETCDF files for each quantity. - ! winds in NORTH and EAST direction (not rotated) - ! file variable names are: - ! rsds (shortwave W/m^2), 3 hr average - ! rlds (longwave W/m^2), 3 hr average - ! ttlpcp (precipitation kg/m s-1), 3 hr average - ! uas (eastward wind m/s), instantaneous - ! vas (northward wind m/s), instantaneous - ! tas (air temperature K), instantaneous - ! huss (specific humidity kg/kg), instantaneous - !------------------------------------------------------------------- - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year - - character(len=*), parameter :: subname = '(JRA55do_gx3_files)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_uas_gx3_2005.nc' call file_year(uwind_file,yr) - - vwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_vas_gx3_2005.nc' - call file_year(vwind_file,yr) - - tair_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_tas_gx3_2005.nc' - call file_year(tair_file,yr) - - humid_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_huss_gx3_2005.nc' - call file_year(humid_file,yr) - - rain_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_ttlpcp_gx3_2005.nc' - call file_year(rain_file,yr) - - fsw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rsds_gx3_2005.nc' - call file_year(fsw_file,yr) - - flw_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_rlds_gx3_2005.nc' - call file_year(flw_file,yr) - - if (my_task == master_task) then write (nu_diag,*) ' ' write (nu_diag,*) 'Atmospheric data files:' write (nu_diag,*) trim(uwind_file) - write (nu_diag,*) trim(vwind_file) - write (nu_diag,*) trim(tair_file) - write (nu_diag,*) trim(humid_file) - write (nu_diag,*) trim(rain_file) - write (nu_diag,*) trim(fsw_file) - write (nu_diag,*) trim(flw_file) endif - end subroutine JRA55do_gx3_files + end subroutine JRA55_files !======================================================================= - - #ifdef UNDEPRECATE_LYq !======================================================================= ! @@ -3023,284 +2773,6 @@ subroutine JRA55_data end subroutine JRA55_data !======================================================================= - - subroutine JRA55do_data - - use ice_blocks, only: block, get_block - use ice_global_reductions, only: global_minval, global_maxval - use ice_domain, only: nblocks, distrb_info - use ice_flux, only: fsnow, Tair, uatm, vatm, Qa, fsw, flw - use ice_grid, only: hm, tmask, umask - use ice_state, only: aice - use ice_calendar, only: days_per_year - - integer (kind=int_kind) :: & - ncid , & ! netcdf file id - i, j, n1 , & - lfyear , & ! local year value - recnum , & ! record number - maxrec , & ! maximum record number - iblk ! block index - - integer (kind=int_kind), save :: & - frec_info(2,2) = -99 ! remember prior values to reduce reading - ! first dim is yr, recnum - ! second dim is data1 data2 - - real (kind=dbl_kind) :: & - sec3hr , & ! number of seconds in 3 hours - secday , & ! number of seconds in day - eps, tt , & ! for interpolation coefficients - Tffresh , & - vmin, vmax - - character(len=64) :: fieldname !netcdf field name - - character(len=*), parameter :: subname = '(JRA55do_data)' - - if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - - call icepack_query_parameters(Tffresh_out=Tffresh) - call icepack_query_parameters(secday_out=secday) - call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & - file=__FILE__, line=__LINE__) - - sec3hr = secday/c8 ! seconds in 3 hours - maxrec = days_per_year * 8 - - if (local_debug .and. my_task == master_task) then - write(nu_diag,*) subname,'fdbg dpy, maxrec = ',days_per_year,maxrec - endif - - !------------------------------------------------------------------- - ! 3-hourly data. - ! states are instantaneous, 1st record is 00z Jan 1 - ! fluxes are 3 hour averages, 1st record is 00z-03z Jan 1 - ! interpolate states, do not interpolate fluxes - !------------------------------------------------------------------- - ! Individual NETCDF files for each quantity. - ! winds in NORTH and EAST direction (not rotated) - ! file variable names are: - ! rsds (shortwave W/m^2), 3 hr average - ! rlds (longwave W/m^2), 3 hr average - ! ttlpcp (precipitation kg/m s-1), 3 hr average - ! uas (eastward wind m/s), instantaneous - ! vas (northward wind m/s), instantaneous - ! tas (air temperature K), instantaneous - ! huss (specific humidity kg/kg), instantaneous - !------------------------------------------------------------------- - - do n1 = 1, 2 - - lfyear = fyear - if (n1 == 1) then - recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) - call file_year(tair_file, lfyear) ! make file name with proper year - call file_year(uwind_file, lfyear) ! make file name with proper year - call file_year(vwind_file, lfyear) ! make file name with proper year - call file_year(humid_file, lfyear) ! make file name with proper year - call file_year(fsw_file, lfyear) ! make file name with proper year - call file_year(flw_file, lfyear) ! make file name with proper year - call file_year(rain_file, lfyear) ! make file name with proper year - - if (my_task == master_task .and. (recnum <= 2 .or. recnum >= maxrec-1)) then - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(tair_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(uwind_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(vwind_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(humid_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(fsw_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(flw_file) - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(rain_file) - endif - elseif (n1 == 2) then - recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) + 1 - if (recnum > maxrec) then - lfyear = fyear + 1 ! next year - if (lfyear > fyear_final) lfyear = fyear_init - recnum = 1 - call file_year(tair_file, lfyear) ! make file name with proper year - call file_year(uwind_file, lfyear) ! make file name with proper year - call file_year(vwind_file, lfyear) ! make file name with proper year - call file_year(humid_file, lfyear) ! make file name with proper year - call file_year(fsw_file, lfyear) ! make file name with proper year - call file_year(flw_file, lfyear) ! make file name with proper year - call file_year(rain_file, lfyear) ! make file name with proper year - - if (my_task == master_task) then - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(tair_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(uwind_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(vwind_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(humid_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(fsw_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(flw_file) - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(rain_file) - endif - endif - endif - - if (local_debug .and. my_task == master_task) then - write(nu_diag,*) subname,'fdbg read recnum = ',recnum,n1 - endif - - ! to reduce reading, check whether it's the same data as last read - - if (lfyear /= frec_info(1,n1) .or. recnum /= frec_info(2,n1)) then - - ! check whether we can copy values from 2 to 1, should be faster than reading - ! can only do this from 2 to 1 or 1 to 2 without setting up a temporary - ! it's more likely that the values from data2 when time advances are needed in data1 - ! compare n1=1 year/record with data from last timestep at n1=2 - - if (n1 == 1 .and. lfyear == frec_info(1,2) .and. recnum == frec_info(2,2)) then - Tair_data(:,:,1,:) = Tair_data(:,:,2,:) - uatm_data(:,:,1,:) = uatm_data(:,:,2,:) - vatm_data(:,:,1,:) = vatm_data(:,:,2,:) - Qa_data(:,:,1,:) = Qa_data(:,:,2,:) - fsw_data(:,:,1,:) = fsw_data(:,:,2,:) - flw_data(:,:,1,:) = flw_data(:,:,2,:) - fsnow_data(:,:,1,:) = fsnow_data(:,:,2,:) - else - - ! read each variable from individual NetCDFs - fieldname = 'tas' - call ice_open_nc(tair_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,Tair_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'uas' - call ice_open_nc(uwind_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,uatm_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'vas' - call ice_open_nc(vwind_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,vatm_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'huss' - call ice_open_nc(humid_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,Qa_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'rsds' - call ice_open_nc(fsw_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,fsw_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'rlds' - call ice_open_nc(flw_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,flw_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - fieldname = 'ttlpcp' - call ice_open_nc(rain_file,ncid) - call ice_read_nc(ncid,recnum,fieldname,fsnow_data(:,:,n1,:),local_debug, & - field_loc=field_loc_center, & - field_type=field_type_scalar) - call ice_close_nc(ncid) - - endif ! copy data from n1=2 from last timestep to n1=1 - endif ! input data is same as last timestep - - frec_info(1,n1) = lfyear - frec_info(2,n1) = recnum - - enddo ! n1 - - ! Compute interpolation coefficients - eps = 1.0e-6 - tt = real(mod(msec,nint(sec3hr)),kind=dbl_kind) - c2intp = tt / sec3hr - if (c2intp < c0 .and. c2intp > c0-eps) c2intp = c0 - if (c2intp > c1 .and. c2intp < c1+eps) c2intp = c1 - c1intp = 1.0_dbl_kind - c2intp - if (c2intp < c0 .or. c2intp > c1) then - write(nu_diag,*) subname,' ERROR: c2intp = ',c2intp - call abort_ice (error_message=subname//' ERROR: c2intp out of range', & - file=__FILE__, line=__LINE__) - endif - if (local_debug .and. my_task == master_task) then - write(nu_diag,*) subname,'fdbg c12intp = ',c1intp,c2intp - endif - - ! Interpolate - call interpolate_data (Tair_data, Tair) - call interpolate_data (uatm_data, uatm) - call interpolate_data (vatm_data, vatm) - call interpolate_data (Qa_data, Qa) - ! use 3 hr average for heat flux and precip fields, no interpolation - ! call interpolate_data (fsw_data, fsw) - ! call interpolate_data (flw_data, flw) - ! call interpolate_data (fsnow_data, fsnow) - fsw(:,:,:) = fsw_data(:,:,1,:) - flw(:,:,:) = flw_data(:,:,1,:) - fsnow(:,:,:) = fsnow_data(:,:,1,:) - - !$OMP PARALLEL DO PRIVATE(iblk,i,j) - do iblk = 1, nblocks - ! limit summer Tair values where ice is present - do j = 1, ny_block - do i = 1, nx_block - if (aice(i,j,iblk) > p1) Tair(i,j,iblk) = min(Tair(i,j,iblk), Tffresh+p1) - enddo - enddo - - do j = 1, ny_block - do i = 1, nx_block - Qa (i,j,iblk) = Qa (i,j,iblk) * hm(i,j,iblk) - Tair(i,j,iblk) = Tair(i,j,iblk) * hm(i,j,iblk) - uatm(i,j,iblk) = uatm(i,j,iblk) * hm(i,j,iblk) - vatm(i,j,iblk) = vatm(i,j,iblk) * hm(i,j,iblk) - fsw (i,j,iblk) = fsw (i,j,iblk) * hm(i,j,iblk) - flw (i,j,iblk) = flw (i,j,iblk) * hm(i,j,iblk) - fsnow(i,j,iblk) = fsnow (i,j,iblk) * hm(i,j,iblk) - enddo - enddo - - enddo ! iblk - !$OMP END PARALLEL DO - - if (debug_forcing .or. local_debug) then - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg JRA55do_data' - vmin = global_minval(fsw,distrb_info,tmask) - vmax = global_maxval(fsw,distrb_info,tmask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg fsw',vmin,vmax - vmin = global_minval(flw,distrb_info,tmask) - vmax = global_maxval(flw,distrb_info,tmask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg flw',vmin,vmax - vmin =global_minval(fsnow,distrb_info,tmask) - vmax =global_maxval(fsnow,distrb_info,tmask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg fsnow',vmin,vmax - vmin = global_minval(Tair,distrb_info,tmask) - vmax = global_maxval(Tair,distrb_info,tmask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg Tair',vmin,vmax - vmin = global_minval(uatm,distrb_info,umask) - vmax = global_maxval(uatm,distrb_info,umask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg uatm',vmin,vmax - vmin = global_minval(vatm,distrb_info,umask) - vmax = global_maxval(vatm,distrb_info,umask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg vatm',vmin,vmax - vmin = global_minval(Qa,distrb_info,tmask) - vmax = global_maxval(Qa,distrb_info,tmask) - if (my_task.eq.master_task) write (nu_diag,*) subname,'fdbg Qa',vmin,vmax - endif ! debug_forcing - - end subroutine JRA55do_data - -! ================================================================= ! ! AOMIP shortwave forcing ! standard calculation using solar declination angle From 2a0c23713882ac349fbc90bd145e76fd34266d11 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Thu, 1 Jun 2023 16:33:48 -0500 Subject: [PATCH 06/13] remove extraneous 'i' variable in JRA55_files --- cicecore/cicedyn/general/ice_forcing.F90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 911a1b8a2..3c8858446 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -2258,9 +2258,6 @@ subroutine JRA55_files(yr) yr ! current forcing year ! local variables - integer (kind=int_kind) :: & - i ! used to check for substring - character(len=3) :: & grd ! gx3, gx1, tx1 From 1ec571ff0ae1334cf9213c2ace454f2bd9ad7966 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Fri, 2 Jun 2023 07:33:50 -0500 Subject: [PATCH 07/13] Changed JRA55 filename JRA55_grid instead of grid at end of filename --- cicecore/cicedyn/general/ice_forcing.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 3c8858446..37535357e 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -2279,10 +2279,10 @@ subroutine JRA55_files(yr) ! check if JRA55 or JRA55do if (index(trim(atm_data_type),'JRA55do') > 0) then uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_03hr_forcing_'//grd//'_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55do_'//grd//'_03hr_forcing_2005.nc' else ! assumes only other option os JRA55 uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55_03hr_forcing_'//grd//'_2005.nc' + trim(atm_data_dir)//'/8XDAILY/JRA55_'//grd//'_03hr_forcing_2005.nc' endif call file_year(uwind_file,yr) From d2ead53cde91d69d5a516167c2c923e7c492a2c5 Mon Sep 17 00:00:00 2001 From: daveh150 Date: Thu, 6 Jul 2023 16:08:33 -0500 Subject: [PATCH 08/13] Add jra55do tests to base_suite and quick_suite. This is done via set_nml options. --- configuration/scripts/options/set_nml.jra55do_gx1 | 3 +++ configuration/scripts/options/set_nml.jra55do_gx3 | 3 +++ configuration/scripts/options/set_nml.jra55do_tx1 | 3 +++ configuration/scripts/tests/base_suite.ts | 3 +++ configuration/scripts/tests/quick_suite.ts | 1 + 5 files changed, 13 insertions(+) create mode 100644 configuration/scripts/options/set_nml.jra55do_gx1 create mode 100644 configuration/scripts/options/set_nml.jra55do_gx3 create mode 100644 configuration/scripts/options/set_nml.jra55do_tx1 diff --git a/configuration/scripts/options/set_nml.jra55do_gx1 b/configuration/scripts/options/set_nml.jra55do_gx1 new file mode 100644 index 000000000..658b4c239 --- /dev/null +++ b/configuration/scripts/options/set_nml.jra55do_gx1 @@ -0,0 +1,3 @@ +atm_data_format = 'nc' +atm_data_type = 'JRA55do_gx1' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/JRA55do' diff --git a/configuration/scripts/options/set_nml.jra55do_gx3 b/configuration/scripts/options/set_nml.jra55do_gx3 new file mode 100644 index 000000000..4eb2bda84 --- /dev/null +++ b/configuration/scripts/options/set_nml.jra55do_gx3 @@ -0,0 +1,3 @@ +atm_data_format = 'nc' +atm_data_type = 'JRA55do_gx3' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3/JRA55do' diff --git a/configuration/scripts/options/set_nml.jra55do_tx1 b/configuration/scripts/options/set_nml.jra55do_tx1 new file mode 100644 index 000000000..3815632fb --- /dev/null +++ b/configuration/scripts/options/set_nml.jra55do_tx1 @@ -0,0 +1,3 @@ +atm_data_format = 'nc' +atm_data_type = 'JRA55do_tx1' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/tx1/JRA55do' diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index 8685ab9a8..72eef9777 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -12,6 +12,7 @@ smoke gx3 4x1 diag1,run5day,thread smoke_gx3_8x2_diag1_ smoke gx3 1x8 diag1,run5day,evp1d restart gx1 40x4 droundrobin,medium restart tx1 40x4 dsectrobin,medium +restart tx1 40x4 dsectrobin,medium,jra55do_tx1 restart gx3 4x4 none restart gx3 10x4 maskhalo restart gx3 6x2 alt01 @@ -46,12 +47,14 @@ smoke gbox80 1x1 boxslotcyl smoke gbox12 1x1x12x12x1 boxchan,diag1,debug restart gx3 8x2 modal smoke gx3 8x2 bgcz +smoke gx3 8x2 jra55do_gx3 smoke gx3 8x2 bgczm,debug smoke gx3 8x1 bgcskl,debug #smoke gx3 4x1 bgcz,thread smoke_gx3_8x2_bgcz restart gx1 4x2 bgcsklclim,medium restart gx1 8x1 bgczclim,medium smoke gx1 24x1 medium,run90day,yi2008 +smoke gx1 24x1 medium,run90day,yi2008,jra55do_gx1 smoke gx3 8x1 medium,run90day,yi2008 restart gx1 24x1 short restart gx1 16x2 seabedLKD,gx1apr,short,debug diff --git a/configuration/scripts/tests/quick_suite.ts b/configuration/scripts/tests/quick_suite.ts index 48646673d..25974cb4e 100644 --- a/configuration/scripts/tests/quick_suite.ts +++ b/configuration/scripts/tests/quick_suite.ts @@ -1,5 +1,6 @@ # Test Grid PEs Sets BFB-compare smoke gx3 8x2 diag1,run5day +smoke gx3 8x2 diag1,run5day,jra55do_gx3 smoke gx3 1x1 diag1,run1day restart gbox128 8x1 diag1 restart gx3 4x2 debug,diag1 From 06fd076b585164773e3470d89422d9026c446aa1 Mon Sep 17 00:00:00 2001 From: apcraig Date: Tue, 11 Jul 2023 19:13:46 -0600 Subject: [PATCH 09/13] Update forcing implementation to provide a little more flexibility for JRA55, JRA55do, and ncar bulk atm forcing files. --- cicecore/cicedyn/general/ice_forcing.F90 | 173 +++++++++++------- .../io/io_netcdf/ice_history_write.F90 | 4 +- .../io/io_pio2/ice_history_write.F90 | 2 +- configuration/scripts/options/set_nml.gx1 | 4 +- configuration/scripts/options/set_nml.gx3 | 4 +- .../scripts/options/set_nml.gx3ncarbulk | 2 +- configuration/scripts/options/set_nml.jra55 | 2 + configuration/scripts/options/set_nml.jra55do | 2 + .../scripts/options/set_nml.jra55do_gx1 | 3 - .../scripts/options/set_nml.jra55do_gx3 | 3 - .../scripts/options/set_nml.jra55do_tx1 | 3 - configuration/scripts/options/set_nml.tx1 | 4 +- configuration/scripts/tests/base_suite.ts | 6 +- configuration/scripts/tests/quick_suite.ts | 1 - 14 files changed, 121 insertions(+), 92 deletions(-) create mode 100644 configuration/scripts/options/set_nml.jra55 create mode 100644 configuration/scripts/options/set_nml.jra55do delete mode 100644 configuration/scripts/options/set_nml.jra55do_gx1 delete mode 100644 configuration/scripts/options/set_nml.jra55do_gx3 delete mode 100644 configuration/scripts/options/set_nml.jra55do_tx1 diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 37535357e..acf0ed2ca 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -62,7 +62,7 @@ module ice_forcing fyear_final ! last year in cycle, computed at init character (char_len_long) :: & ! input data file names - uwind_file, & + uwind_file, & ! this is also used a generic file containing all fields for JRA55 vwind_file, & wind_file, & strax_file, & @@ -124,7 +124,7 @@ module ice_forcing ocn_data_format, & ! 'bin'=binary or 'nc'=netcdf atm_data_type, & ! 'default', 'monthly', 'ncar', 'box2001' ! 'hadgem', 'oned', 'calm', 'uniform' - ! 'JRA55_gx1' or 'JRA55_gx3' or 'JRA55_tx1' + ! 'JRA55' or 'JRA55do' bgc_data_type, & ! 'default', 'clim' ocn_data_type, & ! 'default', 'clim', 'ncar', 'oned', 'calm', 'box2001' ! 'hadgem_sst' or 'hadgem_sst_uvocn', 'uniform' @@ -281,16 +281,11 @@ subroutine init_forcing_atmo file=__FILE__, line=__LINE__) endif - if (use_leap_years .and. (trim(atm_data_type) /= 'JRA55_gx1' .and. & - trim(atm_data_type) /= 'JRA55_gx3' .and. & - trim(atm_data_type) /= 'JRA55_tx1' .and. & - trim(atm_data_type) /= 'JRA55do_gx1' .and. & - trim(atm_data_type) /= 'JRA55do_gx3' .and. & - trim(atm_data_type) /= 'JRA55do_tx1' .and. & + if (use_leap_years .and. (index(trim(atm_data_type),'JRA55') == 0 .and. & trim(atm_data_type) /= 'hycom' .and. & trim(atm_data_type) /= 'box2001')) then write(nu_diag,*) 'use_leap_years option is currently only supported for' - write(nu_diag,*) 'JRA55, default , and box2001 atmospheric data' + write(nu_diag,*) 'JRA55, JRA55do, default , and box2001 atmospheric data' call abort_ice(error_message=subname, file=__FILE__, line=__LINE__) endif @@ -305,12 +300,7 @@ subroutine init_forcing_atmo elseif (trim(atm_data_type) == 'LYq') then call LY_files(fyear) #endif - elseif ((trim(atm_data_type) == 'JRA55_gx1') .or. & - (trim(atm_data_type) == 'JRA55_gx3') .or. & - (trim(atm_data_type) == 'JRA55_tx1') .or. & - (trim(atm_data_type) == 'JRA55do_gx1') .or. & - (trim(atm_data_type) == 'JRA55do_gx3') .or. & - (trim(atm_data_type) == 'JRA55do_tx1')) then + elseif (index(trim(atm_data_type),'JRA55') > 0) then call JRA55_files(fyear) elseif (trim(atm_data_type) == 'hadgem') then call hadgem_files(fyear) @@ -652,12 +642,7 @@ subroutine get_forcing_atmo elseif (trim(atm_data_type) == 'LYq') then call LY_data #endif - elseif ((trim(atm_data_type) == 'JRA55_gx1') .or. & - (trim(atm_data_type) == 'JRA55_gx3') .or. & - (trim(atm_data_type) == 'JRA55_tx1') .or. & - (trim(atm_data_type) == 'JRA55do_gx1') .or. & - (trim(atm_data_type) == 'JRA55do_gx3') .or. & - (trim(atm_data_type) == 'JRA55do_tx1')) then + elseif (index(trim(atm_data_type),'JRA55') > 0) then call JRA55_data elseif (trim(atm_data_type) == 'hadgem') then call hadgem_data @@ -1978,58 +1963,63 @@ subroutine ncar_files (yr) ! Edit for other directory structures or filenames. ! Note: The year number in these filenames does not matter, because ! subroutine file_year will insert the correct year. +! Note: atm_data_dir may have NCAR_bulk or not integer (kind=int_kind), intent(in) :: & yr ! current forcing year + character (char_len_long) :: & + atm_data_dir_extra ! atm_dat_dir extra if needed + + integer (kind=int_kind) :: & + strind ! string index + character(len=*), parameter :: subname = '(ncar_files)' if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' - fsw_file = & - trim(atm_data_dir)//'/MONTHLY/swdn.1996.dat' + atm_data_dir_extra = '/NCAR_bulk' + strind = index(trim(atm_data_dir),'NCAR_bulk') + if (strind > 0) then + atm_data_dir_extra = '' + endif + + fsw_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/MONTHLY/swdn.1996.dat' call file_year(fsw_file,yr) - flw_file = & - trim(atm_data_dir)//'/MONTHLY/cldf.1996.dat' + flw_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/MONTHLY/cldf.1996.dat' call file_year(flw_file,yr) - rain_file = & - trim(atm_data_dir)//'/MONTHLY/prec.1996.dat' + rain_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/MONTHLY/prec.1996.dat' call file_year(rain_file,yr) - uwind_file = & - trim(atm_data_dir)//'/4XDAILY/u_10.1996.dat' + uwind_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/4XDAILY/u_10.1996.dat' call file_year(uwind_file,yr) - vwind_file = & - trim(atm_data_dir)//'/4XDAILY/v_10.1996.dat' + vwind_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/4XDAILY/v_10.1996.dat' call file_year(vwind_file,yr) - tair_file = & - trim(atm_data_dir)//'/4XDAILY/t_10.1996.dat' + tair_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/4XDAILY/t_10.1996.dat' call file_year(tair_file,yr) - humid_file = & - trim(atm_data_dir)//'/4XDAILY/q_10.1996.dat' + humid_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/4XDAILY/q_10.1996.dat' call file_year(humid_file,yr) - rhoa_file = & - trim(atm_data_dir)//'/4XDAILY/dn10.1996.dat' + rhoa_file = trim(atm_data_dir)//trim(atm_data_dir_extra)//'/4XDAILY/dn10.1996.dat' call file_year(rhoa_file,yr) if (my_task == master_task) then write (nu_diag,*) ' ' write (nu_diag,*) 'Forcing data year =', fyear write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(fsw_file) - write (nu_diag,*) trim(flw_file) - write (nu_diag,*) trim(rain_file) - write (nu_diag,*) trim(uwind_file) - write (nu_diag,*) trim(vwind_file) - write (nu_diag,*) trim(tair_file) - write (nu_diag,*) trim(humid_file) - write (nu_diag,*) trim(rhoa_file) + write (nu_diag,'(3a)') trim(fsw_file) + write (nu_diag,'(3a)') trim(flw_file) + write (nu_diag,'(3a)') trim(rain_file) + write (nu_diag,'(3a)') trim(uwind_file) + write (nu_diag,'(3a)') trim(vwind_file) + write (nu_diag,'(3a)') trim(tair_file) + write (nu_diag,'(3a)') trim(humid_file) + write (nu_diag,'(3a)') trim(rhoa_file) endif ! master_task end subroutine ncar_files @@ -2253,43 +2243,88 @@ end subroutine LY_files !======================================================================= subroutine JRA55_files(yr) -! + + ! find the JRA55 files: + ! atm_data_type could be JRA55 or JRA55do with/without _grid appended + ! atm_data_dir could contain JRA55 or JRA55do or not + ! actual files could have grid in name in two location or not at all + integer (kind=int_kind), intent(in) :: & - yr ! current forcing year + yr ! current forcing year ! local variables - character(len=3) :: & - grd ! gx3, gx1, tx1 - + character(len=16) :: & + grd ! gx3, gx1, tx1 + + character(len=64) :: & + atm_data_type_prefix ! atm_data_type prefix + + integer (kind=int_kind) :: & + cnt , & ! search for file + strind ! string index + + logical :: & + exists ! file existance + character(len=*), parameter :: subname = '(JRA55_files)' if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + ! this could be JRA55[do] or JRA55[do]_grid, drop the _grid if set + atm_data_type_prefix = trim(atm_data_type) + strind = index(trim(atm_data_type),'_') + if (strind > 0) then + atm_data_type_prefix = atm_data_type(1:strind-1) + endif + ! check for grid version using fortran INDEX intrinsic - if (index(trim(atm_data_type),'gx1') > 0) then + if (index(trim(atm_data_dir),'gx1') > 0) then grd = 'gx1' - else if (index(trim(atm_data_type),'gx3') > 0) then + else if (index(trim(atm_data_dir),'gx3') > 0) then grd = 'gx3' - else if (index(trim(atm_data_type),'tx1') > 0) then + else if (index(trim(atm_data_dir),'tx1') > 0) then grd = 'tx1' else call abort_ice(error_message=subname//' unknown grid type') endif - - ! check if JRA55 or JRA55do - if (index(trim(atm_data_type),'JRA55do') > 0) then - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55do_'//grd//'_03hr_forcing_2005.nc' - else ! assumes only other option os JRA55 - uwind_file = & - trim(atm_data_dir)//'/8XDAILY/JRA55_'//grd//'_03hr_forcing_2005.nc' + + exists = .false. + cnt = 1 + do while (.not.exists .and. cnt <= 6) + if (cnt == 1) 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)// & + '/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)// & + '/8XDAILY/'//trim(atm_data_type_prefix)// '_03hr_forcing_2005.nc' + + if (cnt == 4) 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)// & + '/8XDAILY/'//trim(atm_data_type_prefix)//'_03hr_forcing_'//trim(grd)//'_2005.nc' + + if (cnt == 6) 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 + cnt = cnt + 1 + enddo + + if (.not.exists) then + call abort_ice(error_message=subname//' could not find forcing file') endif - - call file_year(uwind_file,yr) + if (my_task == master_task) then - write (nu_diag,*) ' ' - write (nu_diag,*) 'Atmospheric data files:' - write (nu_diag,*) trim(uwind_file) + write (nu_diag,'(2a)') ' ' + write (nu_diag,'(2a)') subname,'Atmospheric data files:' + write (nu_diag,'(2a)') subname,trim(uwind_file) endif end subroutine JRA55_files @@ -2590,7 +2625,7 @@ subroutine JRA55_data uwind_file_old = uwind_file if (uwind_file /= uwind_file_old .and. my_task == master_task) then - write(nu_diag,*) subname,' reading forcing file = ',trim(uwind_file) + write(nu_diag,'(2a)') subname,' reading forcing file = ',trim(uwind_file) endif call ice_open_nc(uwind_file,ncid) @@ -2602,7 +2637,7 @@ subroutine JRA55_data if (n1 == 1) then recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) if (my_task == master_task .and. (recnum <= 2 .or. recnum >= maxrec-1)) then - write(nu_diag,*) subname,' reading forcing file 1st ts = ',trim(uwind_file) + write(nu_diag,'(3a)') subname,' reading forcing file 1st ts = ',trim(uwind_file) endif elseif (n1 == 2) then recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) + 1 @@ -2612,7 +2647,7 @@ subroutine JRA55_data recnum = 1 call file_year(uwind_file,lfyear) if (my_task == master_task) then - write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(uwind_file) + write(nu_diag,'(3a)') subname,' reading forcing file 2nd ts = ',trim(uwind_file) endif call ice_close_nc(ncid) call ice_open_nc(uwind_file,ncid) diff --git a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 index bfbe31707..51d76a6f4 100644 --- a/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90 @@ -753,7 +753,7 @@ subroutine ice_write_hist (ns) !----------------------------------------------------------------- ! write time variable !----------------------------------------------------------------- - + ltime2 = timesecs/secday ! hist_time_axis = 'end' (default) ! Some coupled models require the time axis "stamp" to be in the middle @@ -762,7 +762,7 @@ subroutine ice_write_hist (ns) if (trim(hist_time_axis) == "begin" ) ltime2 = time_beg(ns) if (trim(hist_time_axis) == "middle") ltime2 = p5*(time_beg(ns)+time_end(ns)) endif - + status = nf90_inq_varid(ncid,'time',varid) if (status /= nf90_noerr) call abort_ice(subname// & 'ERROR: getting time varid') diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90 index 877071a11..cf2f40521 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90 @@ -715,7 +715,7 @@ subroutine ice_write_hist (ns) if (trim(hist_time_axis) == "begin" ) ltime2 = time_beg(ns) if (trim(hist_time_axis) == "middle") ltime2 = p5*(time_beg(ns)+time_end(ns)) endif - + status = pio_inq_varid(File,'time',varid) status = pio_put_var(File,varid,(/1/),ltime2) diff --git a/configuration/scripts/options/set_nml.gx1 b/configuration/scripts/options/set_nml.gx1 index 50615e81e..781da3389 100644 --- a/configuration/scripts/options/set_nml.gx1 +++ b/configuration/scripts/options/set_nml.gx1 @@ -14,8 +14,8 @@ maskhalo_remap = .true. maskhalo_bound = .true. fyear_init = 2005 atm_data_format = 'nc' -atm_data_type = 'JRA55_gx1' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/JRA55' +atm_data_type = 'JRA55' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1' precip_units = 'mks' ocn_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/CESM/MONTHLY' bgc_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/WOA/MONTHLY' diff --git a/configuration/scripts/options/set_nml.gx3 b/configuration/scripts/options/set_nml.gx3 index 1a2fe62a5..3492509c6 100644 --- a/configuration/scripts/options/set_nml.gx3 +++ b/configuration/scripts/options/set_nml.gx3 @@ -11,8 +11,8 @@ kmt_file = 'ICE_MACHINE_INPUTDATA/CICE_data/grid/gx3/kmt_gx3.bin' bathymetry_file = 'ICE_MACHINE_INPUTDATA/CICE_data/grid/gx3/global_gx3.bathy.nc' fyear_init = 2005 atm_data_format = 'nc' -atm_data_type = 'JRA55_gx3' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3/JRA55' +atm_data_type = 'JRA55' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3' precip_units = 'mks' ocn_data_format = 'bin' ocn_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3/' diff --git a/configuration/scripts/options/set_nml.gx3ncarbulk b/configuration/scripts/options/set_nml.gx3ncarbulk index fbe0f7ae7..044c77a54 100644 --- a/configuration/scripts/options/set_nml.gx3ncarbulk +++ b/configuration/scripts/options/set_nml.gx3ncarbulk @@ -4,6 +4,6 @@ use_restart_time = .true. fyear_init = 1997 atm_data_format = 'bin' atm_data_type = 'ncar' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3/NCAR_bulk' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3' precip_units = 'mm_per_month' diff --git a/configuration/scripts/options/set_nml.jra55 b/configuration/scripts/options/set_nml.jra55 new file mode 100644 index 000000000..465152498 --- /dev/null +++ b/configuration/scripts/options/set_nml.jra55 @@ -0,0 +1,2 @@ +atm_data_format = 'nc' +atm_data_type = 'JRA55' diff --git a/configuration/scripts/options/set_nml.jra55do b/configuration/scripts/options/set_nml.jra55do new file mode 100644 index 000000000..5ca4cb397 --- /dev/null +++ b/configuration/scripts/options/set_nml.jra55do @@ -0,0 +1,2 @@ +atm_data_format = 'nc' +atm_data_type = 'JRA55do' diff --git a/configuration/scripts/options/set_nml.jra55do_gx1 b/configuration/scripts/options/set_nml.jra55do_gx1 deleted file mode 100644 index 658b4c239..000000000 --- a/configuration/scripts/options/set_nml.jra55do_gx1 +++ /dev/null @@ -1,3 +0,0 @@ -atm_data_format = 'nc' -atm_data_type = 'JRA55do_gx1' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/JRA55do' diff --git a/configuration/scripts/options/set_nml.jra55do_gx3 b/configuration/scripts/options/set_nml.jra55do_gx3 deleted file mode 100644 index 4eb2bda84..000000000 --- a/configuration/scripts/options/set_nml.jra55do_gx3 +++ /dev/null @@ -1,3 +0,0 @@ -atm_data_format = 'nc' -atm_data_type = 'JRA55do_gx3' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx3/JRA55do' diff --git a/configuration/scripts/options/set_nml.jra55do_tx1 b/configuration/scripts/options/set_nml.jra55do_tx1 deleted file mode 100644 index 3815632fb..000000000 --- a/configuration/scripts/options/set_nml.jra55do_tx1 +++ /dev/null @@ -1,3 +0,0 @@ -atm_data_format = 'nc' -atm_data_type = 'JRA55do_tx1' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/tx1/JRA55do' diff --git a/configuration/scripts/options/set_nml.tx1 b/configuration/scripts/options/set_nml.tx1 index 5e66db871..c21231a0f 100644 --- a/configuration/scripts/options/set_nml.tx1 +++ b/configuration/scripts/options/set_nml.tx1 @@ -6,8 +6,8 @@ grid_type = 'tripole' ns_boundary_type = 'tripole' grid_file = 'ICE_MACHINE_INPUTDATA/CICE_data/grid/tx1/grid_tx1.bin' kmt_file = 'ICE_MACHINE_INPUTDATA/CICE_data/grid/tx1/kmt_tx1.bin' -atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/tx1/JRA55' +atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/tx1' atm_data_format = 'nc' -atm_data_type = 'JRA55_tx1' +atm_data_type = 'JRA55' year_init = 2005 fyear_init = 2005 diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index 72eef9777..906aae08d 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -12,7 +12,7 @@ smoke gx3 4x1 diag1,run5day,thread smoke_gx3_8x2_diag1_ smoke gx3 1x8 diag1,run5day,evp1d restart gx1 40x4 droundrobin,medium restart tx1 40x4 dsectrobin,medium -restart tx1 40x4 dsectrobin,medium,jra55do_tx1 +restart tx1 40x4 dsectrobin,medium,jra55do restart gx3 4x4 none restart gx3 10x4 maskhalo restart gx3 6x2 alt01 @@ -47,14 +47,14 @@ smoke gbox80 1x1 boxslotcyl smoke gbox12 1x1x12x12x1 boxchan,diag1,debug restart gx3 8x2 modal smoke gx3 8x2 bgcz -smoke gx3 8x2 jra55do_gx3 +smoke gx3 8x2 jra55do smoke gx3 8x2 bgczm,debug smoke gx3 8x1 bgcskl,debug #smoke gx3 4x1 bgcz,thread smoke_gx3_8x2_bgcz restart gx1 4x2 bgcsklclim,medium restart gx1 8x1 bgczclim,medium smoke gx1 24x1 medium,run90day,yi2008 -smoke gx1 24x1 medium,run90day,yi2008,jra55do_gx1 +smoke gx1 24x1 medium,run90day,yi2008,jra55do smoke gx3 8x1 medium,run90day,yi2008 restart gx1 24x1 short restart gx1 16x2 seabedLKD,gx1apr,short,debug diff --git a/configuration/scripts/tests/quick_suite.ts b/configuration/scripts/tests/quick_suite.ts index 25974cb4e..48646673d 100644 --- a/configuration/scripts/tests/quick_suite.ts +++ b/configuration/scripts/tests/quick_suite.ts @@ -1,6 +1,5 @@ # Test Grid PEs Sets BFB-compare smoke gx3 8x2 diag1,run5day -smoke gx3 8x2 diag1,run5day,jra55do_gx3 smoke gx3 1x1 diag1,run1day restart gbox128 8x1 diag1 restart gx3 4x2 debug,diag1 From 1b7009e9ace543f2935bc7799470fc542a5203ba Mon Sep 17 00:00:00 2001 From: apcraig Date: Tue, 11 Jul 2023 19:30:20 -0600 Subject: [PATCH 10/13] Update documentation --- doc/source/developer_guide/dg_forcing.rst | 15 ++++++++++----- doc/source/developer_guide/dg_tools.rst | 4 ++-- doc/source/user_guide/ug_case_settings.rst | 7 +++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/source/developer_guide/dg_forcing.rst b/doc/source/developer_guide/dg_forcing.rst index 0b90a9b2e..a9bb186ca 100644 --- a/doc/source/developer_guide/dg_forcing.rst +++ b/doc/source/developer_guide/dg_forcing.rst @@ -24,9 +24,9 @@ use aspects of the following approach, - Input files are organized by year. - Namelist inputs ``fyear`` and ``ycycle`` specify the forcing year dataset. - The forcing year is computed on the fly and is assumed to be cyclical over the forcing dataset length defined by ``ycycle``. -- The namelist ``atm_dat_dir`` specifies the directory of the atmosphere input data files and the namelist ``atm_data_type`` defines the atmospheric forcing mode. -- The namelist ``ocn_dat_dir`` specifies the directory of the ocean input data files and the namelist ``ocn_data_type`` defines the ocean forcing mode. -- The filenames follow a particular naming convention that is defined in the source code (ie. subroutine **JRA55_gx1_files**). The forcing year is typically found just before the **.nc** part of the filename and there are tools (subroutine **file_year**) to update the filename based on the model year and appropriate forcing year. +- The namelist ``atm_data_dir`` specifies the directory or a portion of the directory for the atmosphere input data files and the namelist ``atm_data_type`` defines the atmospheric forcing mode. ``atm_data_type`` values of ``JRA55``, ``JRA55do``, or ``ncar`` provide some flexibility for directory paths and filenames. These details are best understood by studying the **ice_forcing.F90** source code. +- The namelist ``ocn_data_dir`` specifies the directory of the ocean input data files and the namelist ``ocn_data_type`` defines the ocean forcing mode. +- The filenames follow a particular naming convention that is defined in the source code (ie. subroutine **JRA55_files**). The forcing year is typically found just before the **.nc** part of the filename and there are tools (subroutine **file_year**) to update the filename based on the model year and appropriate forcing year. - The input data time axis is generally NOT read by the forcing subroutine. The forcing frequency is hardwired into the model and the file record number is computed based on the forcing frequency and model time. Mixing leap year input data and noleap model calendars (and vice versa) is not handled particularly gracefully. The CICE model does not read or check against the input data time axis. - Data is read on the model grid, no spatial interpolation exists. - Data is often time interpolated linearly between two input timestamps to the model time each model timestep. @@ -79,8 +79,8 @@ input data fields to model forcing fields. .. _JRA55forcing: -JRA55 Atmosphere Forcing -------------------------- +JRA55 and JRA55do Atmosphere Forcing +------------------------------------ The current default atmosphere forcing for gx3, gx1, and tx1 standalone grids for Consortium testing is the JRA55 forcing @@ -136,6 +136,11 @@ March 1, and all data after March 1 will be shifted one day. December 31 in leap years will be skipped when running with a CICE calendar with no leap days. +JRA55do forcing is also provided by the Consortium in the same format and scheme. The JRA55do +dataset is more focused on forcing for ocean and ice models, but provides a very similar climate +as the JRA55 forcing. To switch to JRA55do, set the namelist ``atm_data_type`` to ``JRA55do`` +and populate the input data directory with the JRA55do dataset provided by the Consortium. + .. _NCARforcing: diff --git a/doc/source/developer_guide/dg_tools.rst b/doc/source/developer_guide/dg_tools.rst index ba29e0184..74df2343b 100644 --- a/doc/source/developer_guide/dg_tools.rst +++ b/doc/source/developer_guide/dg_tools.rst @@ -27,10 +27,10 @@ JRA55 forcing datasets ------------------------ This section describes how to generate JRA55 forcing data for the CICE model. -Raw JRA55 files have to be interpolated and processed into input files specifically +Raw JRA55 or JRA55do files have to be interpolated and processed into input files specifically for the CICE model. A tool exists in **configuration/tools/jra55_datasets** to support that process. -The raw JRA55 data is obtained from the NCAR/UCAR Research Data Archive and +The raw JRA55 or JRA55do data is obtained from the NCAR/UCAR Research Data Archive and the conversion tools are written in python. Requirements diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index d5ec89df1..516f3238d 100644 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -596,15 +596,14 @@ forcing_nml "", "``constant``", "constant-based boundary layer", "" "", "``mixed``", "stability-based boundary layer for wind stress, constant-based for sensible+latent heat fluxes", "" "``atmiter_conv``", "real", "convergence criteria for ustar", "0.0" - "``atm_data_dir``", "string", "path to atmospheric forcing data directory", "" + "``atm_data_dir``", "string", "path or partial path to atmospheric forcing data directory", "" "``atm_data_format``", "``bin``", "read direct access binary atmo forcing file format", "``bin``" "", "``nc``", "read netcdf atmo forcing files", "" "``atm_data_type``", "``box2001``", "forcing data for :cite:`Hunke01` box problem", "``default``" "", "``default``", "constant values defined in the code", "" "", "``hycom``", "HYCOM atm forcing data in netcdf format", "" - "", "``JRA55_gx1``", "JRA55 forcing data for gx1 grid :cite:`Tsujino18`", "" - "", "``JRA55_gx3``", "JRA55 forcing data for gx3 grid :cite:`Tsujino18`", "" - "", "``JRA55_tx1``", "JRA55 forcing data for tx1 grid :cite:`Tsujino18`", "" + "", "``JRA55``", "JRA55 forcing data :cite:`Tsujino18`", "" + "", "``JRA55do``", "JRA55do forcing data :cite:`Tsujino18`", "" "", "``monthly``", "monthly forcing data", "" "", "``ncar``", "NCAR bulk forcing data", "" "", "``oned``", "column forcing data", "" From 08739f5f125af44421416c793835e114bd8ba995 Mon Sep 17 00:00:00 2001 From: apcraig Date: Wed, 12 Jul 2023 21:00:38 -0500 Subject: [PATCH 11/13] update Onyx port --- configuration/scripts/machines/Macros.onyx_intel | 4 ++-- configuration/scripts/machines/env.onyx_cray | 12 ++++++------ configuration/scripts/machines/env.onyx_gnu | 12 ++++++------ configuration/scripts/machines/env.onyx_intel | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/configuration/scripts/machines/Macros.onyx_intel b/configuration/scripts/machines/Macros.onyx_intel index 92879ee82..17cec8c74 100644 --- a/configuration/scripts/machines/Macros.onyx_intel +++ b/configuration/scripts/machines/Macros.onyx_intel @@ -4,11 +4,11 @@ CPP := fpp CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} -CFLAGS := -c -O2 -fp-model precise -xHost +CFLAGS := -c -O2 -fp-model precise FIXEDFLAGS := -132 FREEFLAGS := -FR -FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback -xHost +FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback FFLAGS_NOOPT:= -O0 ifeq ($(ICE_BLDDEBUG), true) diff --git a/configuration/scripts/machines/env.onyx_cray b/configuration/scripts/machines/env.onyx_cray index e696d1b98..e879cdf03 100644 --- a/configuration/scripts/machines/env.onyx_cray +++ b/configuration/scripts/machines/env.onyx_cray @@ -13,14 +13,14 @@ module unload PrgEnv-cray module unload PrgEnv-gnu module unload PrgEnv-intel module unload PrgEnv-pgi -module load PrgEnv-cray/6.0.9 +module load PrgEnv-cray/6.0.10 module unload cce -module load cce/11.0.2 +module load cce/14.0.3 module unload cray-mpich module unload cray-mpich2 -module load cray-mpich/7.7.16 +module load cray-mpich/7.7.20 module unload netcdf module unload cray-netcdf @@ -28,8 +28,8 @@ module unload cray-hdf5 module unload cray-hdf5-parallel module unload cray-netcdf-hdf5parallel module unload cray-parallel-netcdf -module load cray-netcdf/4.7.4.0 -module load cray-hdf5/1.12.0.0 +module load cray-netcdf/4.8.1.3 +module load cray-hdf5/1.12.1.3 module unload cray-libsci module unload craype-hugepages2M @@ -46,7 +46,7 @@ endif setenv ICE_MACHINE_MACHNAME onyx setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell" setenv ICE_MACHINE_ENVNAME cray -setenv ICE_MACHINE_ENVINFO "Cray cce/11.0.2, cray-mpich/7.7.16, netcdf/4.7.4.0" +setenv ICE_MACHINE_ENVINFO "Cray cce/14.0.3, cray-mpich/7.7.20, netcdf/4.8.1.3" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium diff --git a/configuration/scripts/machines/env.onyx_gnu b/configuration/scripts/machines/env.onyx_gnu index 80ebb8e43..19a4eb701 100644 --- a/configuration/scripts/machines/env.onyx_gnu +++ b/configuration/scripts/machines/env.onyx_gnu @@ -13,14 +13,14 @@ module unload PrgEnv-cray module unload PrgEnv-gnu module unload PrgEnv-intel module unload PrgEnv-pgi -module load PrgEnv-gnu/6.0.9 +module load PrgEnv-gnu/6.0.10 module unload gcc -module load gcc/10.2.0 +module load gcc/12.1.0 module unload cray-mpich module unload cray-mpich2 -module load cray-mpich/7.7.16 +module load cray-mpich/7.7.20 module unload netcdf module unload cray-netcdf @@ -28,8 +28,8 @@ module unload cray-hdf5 module unload cray-hdf5-parallel module unload cray-netcdf-hdf5parallel module unload cray-parallel-netcdf -module load cray-netcdf/4.7.4.0 -module load cray-hdf5/1.12.0.0 +module load cray-netcdf/4.8.1.3 +module load cray-hdf5/1.12.1.3 module unload cray-libsci module unload craype-hugepages2M @@ -46,7 +46,7 @@ endif setenv ICE_MACHINE_MACHNAME onyx setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell" setenv ICE_MACHINE_ENVNAME gnu -setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 10.2.0, cray-mpich/7.7.16, netcdf/4.7.4.0" +setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 12.1.0, cray-mpich/7.7.20, netcdf/4.8.1.3" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium diff --git a/configuration/scripts/machines/env.onyx_intel b/configuration/scripts/machines/env.onyx_intel index 362454dd4..999d5a2bd 100644 --- a/configuration/scripts/machines/env.onyx_intel +++ b/configuration/scripts/machines/env.onyx_intel @@ -13,14 +13,14 @@ module unload PrgEnv-cray module unload PrgEnv-gnu module unload PrgEnv-intel module unload PrgEnv-pgi -module load PrgEnv-intel/6.0.9 +module load PrgEnv-intel/6.0.10 module unload intel -module load intel/19.1.3.304 +module load intel/2021.4.0 module unload cray-mpich module unload cray-mpich2 -module load cray-mpich/7.7.16 +module load cray-mpich/7.7.20 module unload netcdf module unload cray-netcdf @@ -28,8 +28,8 @@ module unload cray-hdf5 module unload cray-hdf5-parallel module unload cray-netcdf-hdf5parallel module unload cray-parallel-netcdf -module load cray-netcdf/4.7.4.0 -module load cray-hdf5/1.12.0.0 +module load cray-netcdf/4.8.1.3 +module load cray-hdf5/1.12.1.3 module unload cray-libsci module unload craype-hugepages2M @@ -46,7 +46,7 @@ endif setenv ICE_MACHINE_MACHNAME onyx setenv ICE_MACHINE_MACHINFO "Cray XC40/50 Xeon E5-2699v4 Broadwell" setenv ICE_MACHINE_ENVNAME intel -setenv ICE_MACHINE_ENVINFO "ifort 19.1.3.304, cray-mpich/7.7.16, netcdf/4.7.4.0" +setenv ICE_MACHINE_ENVINFO "ifort 2021.4.0, cray-mpich/7.7.20, netcdf/4.8.1.3" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR $WORKDIR/CICE_RUNS setenv ICE_MACHINE_INPUTDATA /p/app/unsupported/RASM/cice_consortium From 82b61fdc884bcb061caabf31e86da4ebb6c29e20 Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 13 Jul 2023 12:51:32 -0600 Subject: [PATCH 12/13] Update forcing documentation Initial port to derecho_intel --- cicecore/cicedyn/general/ice_forcing.F90 | 42 +++++++++-- configuration/scripts/cice.batch.csh | 15 ++++ configuration/scripts/cice.launch.csh | 12 ++++ .../scripts/machines/Macros.derecho_intel | 69 ++++++++++++++++++ .../scripts/machines/env.derecho_intel | 70 +++++++++++++++++++ doc/source/developer_guide/dg_forcing.rst | 4 +- 6 files changed, 204 insertions(+), 8 deletions(-) create mode 100644 configuration/scripts/machines/Macros.derecho_intel create mode 100644 configuration/scripts/machines/env.derecho_intel diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 4d90a21af..851213579 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -1934,11 +1934,18 @@ end subroutine longwave_rosati_miyakoda subroutine ncar_files (yr) -! Construct filenames based on the LANL naming conventions for NCAR data. -! Edit for other directory structures or filenames. -! Note: The year number in these filenames does not matter, because -! subroutine file_year will insert the correct year. -! Note: atm_data_dir may have NCAR_bulk or not + ! Construct filenames based on the LANL naming conventions for NCAR data. + ! Edit for other directory structures or filenames. + ! Note: The year number in these filenames does not matter, because + ! subroutine file_year will insert the correct year. + ! Note: atm_data_dir may have NCAR_bulk or not + ! + ! atm_data_type should be 'ncar' + ! atm_dat_dir should be ${CICE_DATA_root}/forcing/$grid/[NCAR_bulk,''] + ! atm_data_dir should be set to ${CICE_DATA_root}/forcing/$grid/[JRA55,JRA55do,''] + ! NCAR_bulk at the end of the atm_data_dir is optional to provide backwards + ! compatibility and if not included, will be appended automaticaly. + ! The grid is typically gx1, gx3, tx1, or similar. integer (kind=int_kind), intent(in) :: & yr ! current forcing year @@ -1953,6 +1960,7 @@ subroutine ncar_files (yr) if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start' + ! decide whether NCAR_bulk is part of atm_data_dir and set atm_data_dir_extra atm_data_dir_extra = '/NCAR_bulk' strind = index(trim(atm_data_dir),'NCAR_bulk') if (strind > 0) then @@ -2162,9 +2170,30 @@ end subroutine ncar_data subroutine JRA55_files(yr) ! find the JRA55 files: + ! This subroutine finds the JRA55 atm forcing files based on settings + ! in atm_data_type and atm_data_dir. Because the filenames are not + ! entirely consistent, we need a flexible method. + ! ! atm_data_type could be JRA55 or JRA55do with/without _grid appended ! atm_data_dir could contain JRA55 or JRA55do or not ! actual files could have grid in name in two location or not at all + ! + ! The files will generally be of the format + ! $atm_data_type/[JRA55,JRA55do,'']/8XDAILY/[JRA55,JRA55do][_$grid,'']_03hr_forcing[_$grid,'']_$year.nc + ! The options defined by cnt try several versions of paths/filenames + ! As a user, + ! atm_data_type should be set to JRA55, JRA55do, JRA55_xxx, or JRA55do_xxx + ! where xxx can be any set of characters. The _xxx if included will be ignored. + ! Historically, these were set to JRA55_gx1 and so forth but the _gx1 is no longer needed + ! but this is still allowed for backwards compatibility. atm_data_type_prefix + ! is atm_data_type with _ and everything after _ removed. + ! atm_data_dir should be set to ${CICE_DATA_root}/forcing/$grid/[JRA55,JRA55do,''] + ! The [JRA55,JRA55do] at the end of the atm_data_dir is optional to provide backwards + ! compatibility and if not included, will be appended automaticaly using + ! the atm_data_type_prefix value. The grid is typically gx1, gx3, tx1, or similar. + ! In general, we recommend using the following format + ! atm_data_type = [JRA55,JRA55do] + ! atm_data_dir = ${CICE_DATA_root}/forcing/$grid integer (kind=int_kind), intent(in) :: & yr ! current forcing year @@ -2177,7 +2206,7 @@ subroutine JRA55_files(yr) atm_data_type_prefix ! atm_data_type prefix integer (kind=int_kind) :: & - cnt , & ! search for file + cnt , & ! search for files strind ! string index logical :: & @@ -2205,6 +2234,7 @@ subroutine JRA55_files(yr) call abort_ice(error_message=subname//' unknown grid type') endif + ! 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) diff --git a/configuration/scripts/cice.batch.csh b/configuration/scripts/cice.batch.csh index 1cf23da45..d1a531de0 100755 --- a/configuration/scripts/cice.batch.csh +++ b/configuration/scripts/cice.batch.csh @@ -33,6 +33,21 @@ cat >> ${jobfile} << EOFB #PBS -l walltime=${batchtime} EOFB +else if (${ICE_MACHINE} =~ derecho*) then +cat >> ${jobfile} << EOFB +#PBS -q ${queue} +#PBS -l job_priority=regular +#PBS -N ${ICE_CASENAME} +#PBS -A ${acct} +#PBS -l select=${nnodes}:ncpus=${corespernode}:mpiprocs=${taskpernodelimit}:ompthreads=${nthrds} +#PBS -l walltime=${batchtime} +#PBS -j oe +#PBS -W umask=022 +#PBS -o ${ICE_CASEDIR} +###PBS -M username@domain.com +###PBS -m be +EOFB + else if (${ICE_MACHINE} =~ gust*) then cat >> ${jobfile} << EOFB #PBS -q ${queue} diff --git a/configuration/scripts/cice.launch.csh b/configuration/scripts/cice.launch.csh index b13da1813..971bc0075 100755 --- a/configuration/scripts/cice.launch.csh +++ b/configuration/scripts/cice.launch.csh @@ -22,6 +22,18 @@ mpiexec_mpt -np ${ntasks} omplace ./cice >&! \$ICE_RUNLOG_FILE EOFR endif +#======= +else if (${ICE_MACHCOMP} =~ derecho*) then +if (${ICE_COMMDIR} =~ serial*) then +cat >> ${jobfile} << EOFR +./cice >&! \$ICE_RUNLOG_FILE +EOFR +else +cat >> ${jobfile} << EOFR +mpiexec --cpu-bind depth -n ${ntasks} -ppn ${taskpernodelimit} -d ${nthrds} ./cice >&! \$ICE_RUNLOG_FILE +EOFR +endif + #======= else if (${ICE_MACHCOMP} =~ gust*) then if (${ICE_COMMDIR} =~ serial*) then diff --git a/configuration/scripts/machines/Macros.derecho_intel b/configuration/scripts/machines/Macros.derecho_intel new file mode 100644 index 000000000..1ea4fe30c --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_intel @@ -0,0 +1,69 @@ +#============================================================================== +# Makefile macros for NCAR cheyenne, intel compiler +#============================================================================== + +CPP := fpp +CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} +CFLAGS := -c -O2 -fp-model precise -march=core-avx2 + +FIXEDFLAGS := -fixed -132 +FREEFLAGS := -free +FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback -march=core-avx2 +FFLAGS_NOOPT:= -O0 + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS += -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -link_mpi=dbg +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -link_mpi=dbg -stand f08 +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -init=snan,arrays -link_mpi=dbg +else + FFLAGS += -O2 +endif + +SCC := icx +SFC := ifort +MPICC := mpicc +MPIFC := mpif90 + +ifeq ($(ICE_COMMDIR), mpi) + FC := $(MPIFC) + CC := $(MPICC) +else + FC := $(SFC) + CC := $(SCC) +endif +LD:= $(FC) + +NETCDF_PATH := $(NETCDF) + +PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + +#ifeq ($(ICE_IOTYPE), pio1) +# LIB_PIO := $(PIO_LIBDIR) +# SLIBS := $(SLIBS) -L$(LIB_PIO) -lpio +#endif + +ifeq ($(ICE_IOTYPE), pio2) +# CPPDEFS := $(CPPDEFS) -DGPTL +# LIB_PIO := $(PIO_LIBDIR) +# SLIBS := $(SLIBS) -L$(LIB_PIO) -lpiof -lpioc -lgptl + SLIBS := $(SLIBS) -lpiof -lpioc +endif + diff --git a/configuration/scripts/machines/env.derecho_intel b/configuration/scripts/machines/env.derecho_intel new file mode 100644 index 000000000..baa053e75 --- /dev/null +++ b/configuration/scripts/machines/env.derecho_intel @@ -0,0 +1,70 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load intel/2023.0.0 +module load ncarcompilers +module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf-mpi/4.9.2 +module load cray-libsci/23.02.1.1 + +if ($?ICE_IOTYPE) then +if ($ICE_IOTYPE =~ pio*) then + module load parallel-netcdf/1.12.3 + if ($ICE_IOTYPE == "pio1") then + module load parallelio/1.10.1 + else + module load parallelio/2.6.0 + endif +endif +endif + +if ($?ICE_BFBTYPE) then +if ($ICE_BFBTYPE =~ qcchk*) then + module load conda +# conda env create -f ../../configuration/scripts/tests/qctest.yml + conda activate qctest +endif +endif + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +setenv ICE_MACHINE_MACHNAME derecho +setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11" +setenv ICE_MACHINE_ENVNAME intel +setenv ICE_MACHINE_ENVINFO "ifort 2021.8.0 20221119, cray-mpich 2.25, netcdf-mpi4.9.2, pnetcdf1.12.3, pio2.6.0" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/CICE_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/CICE_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 8 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/doc/source/developer_guide/dg_forcing.rst b/doc/source/developer_guide/dg_forcing.rst index a9bb186ca..8cf293843 100644 --- a/doc/source/developer_guide/dg_forcing.rst +++ b/doc/source/developer_guide/dg_forcing.rst @@ -21,10 +21,10 @@ primitive, in part due to historical reasons and in part because standalone runs are discouraged for evaluating complex science. In general, most implementations use aspects of the following approach, -- Input files are organized by year. +- Input files are organized by year. The underlying implementation provides for some flexibility and extensibility in filenames. For instance, JRA55 and JRA55do filenames can have syntax like ``[JRA55,JRA55do][_$grid,'']_03hr_forcing[_$grid,'']_$year.nc`` where $grid is optional or may be present at one of two locations within the filename. This implementation exists to support the current naming conventions within the gx1, gx3, and tx1 JRA55 and JRA55do CICE_DATA directory structure automatically. See **JRA55_files** in **ice_forcing.F90** for more details. - Namelist inputs ``fyear`` and ``ycycle`` specify the forcing year dataset. - The forcing year is computed on the fly and is assumed to be cyclical over the forcing dataset length defined by ``ycycle``. -- The namelist ``atm_data_dir`` specifies the directory or a portion of the directory for the atmosphere input data files and the namelist ``atm_data_type`` defines the atmospheric forcing mode. ``atm_data_type`` values of ``JRA55``, ``JRA55do``, or ``ncar`` provide some flexibility for directory paths and filenames. These details are best understood by studying the **ice_forcing.F90** source code. +- The namelist ``atm_data_dir`` specifies the path or partial path for the atmosphere input data files and the namelist ``atm_data_type`` defines the atmospheric forcing mode. ``atm_data_type`` values of ``JRA55``, ``JRA55do``, or ``ncar`` provide some flexibility for directory paths and filenames. Many details can be gleaned from the CICE_data directory structure and file names as well as from the implementation in **ice_forcing.F90**. But the main point is that atm_data_dir should be set to ${CICE_DATA_root}/forcing/$grid/[JRA55,JRA55do,NCAR_bulk,''] where [JRA55,JRA55do,NCAR_bulk] are optional but provided for backwards compatibility. grid is typically gx1, gx3, tx1, or similar. - The namelist ``ocn_data_dir`` specifies the directory of the ocean input data files and the namelist ``ocn_data_type`` defines the ocean forcing mode. - The filenames follow a particular naming convention that is defined in the source code (ie. subroutine **JRA55_files**). The forcing year is typically found just before the **.nc** part of the filename and there are tools (subroutine **file_year**) to update the filename based on the model year and appropriate forcing year. - The input data time axis is generally NOT read by the forcing subroutine. The forcing frequency is hardwired into the model and the file record number is computed based on the forcing frequency and model time. Mixing leap year input data and noleap model calendars (and vice versa) is not handled particularly gracefully. The CICE model does not read or check against the input data time axis. From 98b0b11046e628b4337a864106fde209287f2703 Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 13 Jul 2023 12:57:54 -0600 Subject: [PATCH 13/13] clean up blank spaces --- cicecore/cicedyn/general/ice_forcing.F90 | 4 ++-- configuration/scripts/cice.batch.csh | 2 +- configuration/scripts/machines/Macros.derecho_intel | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cicecore/cicedyn/general/ice_forcing.F90 b/cicecore/cicedyn/general/ice_forcing.F90 index 851213579..9002d0448 100755 --- a/cicecore/cicedyn/general/ice_forcing.F90 +++ b/cicecore/cicedyn/general/ice_forcing.F90 @@ -2181,7 +2181,7 @@ subroutine JRA55_files(yr) ! The files will generally be of the format ! $atm_data_type/[JRA55,JRA55do,'']/8XDAILY/[JRA55,JRA55do][_$grid,'']_03hr_forcing[_$grid,'']_$year.nc ! The options defined by cnt try several versions of paths/filenames - ! As a user, + ! As a user, ! atm_data_type should be set to JRA55, JRA55do, JRA55_xxx, or JRA55do_xxx ! where xxx can be any set of characters. The _xxx if included will be ignored. ! Historically, these were set to JRA55_gx1 and so forth but the _gx1 is no longer needed @@ -2189,7 +2189,7 @@ subroutine JRA55_files(yr) ! is atm_data_type with _ and everything after _ removed. ! atm_data_dir should be set to ${CICE_DATA_root}/forcing/$grid/[JRA55,JRA55do,''] ! The [JRA55,JRA55do] at the end of the atm_data_dir is optional to provide backwards - ! compatibility and if not included, will be appended automaticaly using + ! compatibility and if not included, will be appended automaticaly using ! the atm_data_type_prefix value. The grid is typically gx1, gx3, tx1, or similar. ! In general, we recommend using the following format ! atm_data_type = [JRA55,JRA55do] diff --git a/configuration/scripts/cice.batch.csh b/configuration/scripts/cice.batch.csh index d1a531de0..5a47decf1 100755 --- a/configuration/scripts/cice.batch.csh +++ b/configuration/scripts/cice.batch.csh @@ -41,7 +41,7 @@ cat >> ${jobfile} << EOFB #PBS -A ${acct} #PBS -l select=${nnodes}:ncpus=${corespernode}:mpiprocs=${taskpernodelimit}:ompthreads=${nthrds} #PBS -l walltime=${batchtime} -#PBS -j oe +#PBS -j oe #PBS -W umask=022 #PBS -o ${ICE_CASEDIR} ###PBS -M username@domain.com diff --git a/configuration/scripts/machines/Macros.derecho_intel b/configuration/scripts/machines/Macros.derecho_intel index 1ea4fe30c..df0d2320e 100644 --- a/configuration/scripts/machines/Macros.derecho_intel +++ b/configuration/scripts/machines/Macros.derecho_intel @@ -35,7 +35,7 @@ LD:= $(FC) NETCDF_PATH := $(NETCDF) -PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs PNETCDF_PATH := $(PNETCDF) #PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib @@ -49,10 +49,10 @@ LIB_NETCDF := $(NETCDF)/lib #SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -ifeq ($(ICE_THREADED), true) - LDFLAGS += -qopenmp - CFLAGS += -qopenmp - FFLAGS += -qopenmp +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp endif #ifeq ($(ICE_IOTYPE), pio1)