-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update gx1 initial condition, Icepack, tests, and version. Fix hmix default value #586
Changes from all commits
8312c2b
a84a347
101e1c1
c0364f4
270d2bb
4dc3bf1
86a3907
dc8aa32
016f4b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,9 @@ module ice_forcing | |
|
||
! PRIVATE: | ||
|
||
real (dbl_kind), parameter :: & | ||
mixed_layer_depth_default = c20 ! default mixed layer depth in m | ||
|
||
logical (kind=log_kind), parameter :: & | ||
forcing_debug = .false. ! local debug flag | ||
|
||
|
@@ -2668,247 +2671,6 @@ subroutine JRA55_data | |
|
||
end subroutine JRA55_data | ||
|
||
!======================================================================= | ||
|
||
subroutine Jra55_data_old (yr) | ||
|
||
use ice_blocks, only: block, get_block | ||
use ice_global_reductions, only: global_minval, global_maxval | ||
use ice_domain, only: nblocks, distrb_info, blocks_ice | ||
use ice_flux, only: fsnow, Tair, uatm, vatm, Qa, fsw, flw | ||
use ice_grid, only: hm, tlon, tlat, tmask, umask | ||
use ice_state, only: aice | ||
use ice_calendar, only: days_per_year, use_leap_years | ||
|
||
integer (kind=int_kind), intent(in) :: & | ||
yr ! current forcing year | ||
|
||
integer (kind=int_kind) :: & | ||
ncid , & ! netcdf file id | ||
i, j, n1, iblk, & | ||
yrp , & ! year after yr in forcing cycle | ||
recnum , & ! record number | ||
maxrec , & ! maximum record number | ||
recslot , & ! spline slot for current record | ||
dataloc ! = 1 for data located in middle of time interval | ||
! = 2 for date located at end of time interval | ||
|
||
real (kind=dbl_kind) :: & | ||
sec3hr , & ! number of seconds in 3 hours | ||
secday , & ! number of seconds in day | ||
eps, tt , & ! interpolation coeff calc | ||
Tffresh , & | ||
vmin, vmax | ||
|
||
logical (kind=log_kind) :: debug_n_d = .false. | ||
|
||
character (char_len_long) :: uwind_file_old | ||
character(len=64) :: fieldname !netcdf field name | ||
character(len=*), parameter :: subname = '(Jra55_data_old)' | ||
|
||
if (forcing_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 (debug_n_d .and. my_task == master_task) then | ||
write (nu_diag,*) subname,'recnum',recnum | ||
write (nu_diag,*) subname,'maxrec',maxrec | ||
write (nu_diag,*) subname,'days_per_year', days_per_year | ||
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 | ||
! Both states and fluxes have 1st record defined as 00z Jan 1 | ||
! interpolate states, do not interpolate fluxes | ||
! fluxes are held constant from [init period, end period) | ||
!------------------------------------------------------------------- | ||
! File is NETCDF with winds in NORTH and EAST direction | ||
! file variable names are: | ||
! glbrad (shortwave W/m^2) | ||
! dlwsfc (longwave W/m^2) | ||
! wndewd (eastward wind m/s) | ||
! wndnwd (northward wind m/s) | ||
! airtmp (air temperature K) | ||
! spchmd (specific humidity kg/kg) | ||
! ttlpcp (precipitation kg/m s-1) | ||
!------------------------------------------------------------------- | ||
|
||
uwind_file_old = uwind_file | ||
call file_year(uwind_file,yr) | ||
if (uwind_file /= uwind_file_old .and. my_task == master_task) then | ||
write(nu_diag,*) subname,' reading forcing file = ',trim(uwind_file) | ||
endif | ||
|
||
call ice_open_nc(uwind_file,ncid) | ||
|
||
do n1 = 1,2 | ||
|
||
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) | ||
endif | ||
elseif (n1 == 2) then | ||
recnum = 8*int(yday) - 7 + int(real(msec,kind=dbl_kind)/sec3hr) + 1 | ||
if (recnum > maxrec) then | ||
yrp = fyear_init + mod(myear,ycycle) ! next year | ||
recnum = 1 | ||
call file_year(uwind_file,yrp) | ||
if (my_task == master_task) then | ||
write(nu_diag,*) subname,' reading forcing file 2nd ts = ',trim(uwind_file) | ||
endif | ||
call ice_close_nc(ncid) | ||
call ice_open_nc(uwind_file,ncid) | ||
endif | ||
endif | ||
|
||
if (debug_n_d .and. my_task == master_task) then | ||
write(nu_diag,*) subname,' read recnum = ',recnum,n1 | ||
endif | ||
|
||
fieldname = 'airtmp' | ||
call ice_read_nc(ncid,recnum,fieldname,Tair_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
fieldname = 'wndewd' | ||
call ice_read_nc(ncid,recnum,fieldname,uatm_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
fieldname = 'wndnwd' | ||
call ice_read_nc(ncid,recnum,fieldname,vatm_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
fieldname = 'spchmd' | ||
call ice_read_nc(ncid,recnum,fieldname,Qa_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
! only read one timestep for fluxes, 3 hr average, no interpolation | ||
if (n1 == 1) then | ||
fieldname = 'glbrad' | ||
call ice_read_nc(ncid,recnum,fieldname,fsw_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
fieldname = 'dlwsfc' | ||
call ice_read_nc(ncid,recnum,fieldname,flw_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
|
||
fieldname = 'ttlpcp' | ||
call ice_read_nc(ncid,recnum,fieldname,fsnow_data(:,:,n1,:),debug_n_d, & | ||
field_loc=field_loc_center, & | ||
field_type=field_type_scalar) | ||
endif | ||
|
||
enddo | ||
|
||
call ice_close_nc(ncid) | ||
|
||
! reset uwind_file to original year | ||
call file_year(uwind_file,yr) | ||
|
||
! 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 (debug_n_d .and. my_task == master_task) then | ||
write(nu_diag,*) subname,' 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 | ||
! 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_n_d .or. dbug) then | ||
if (my_task.eq.master_task) & | ||
write (nu_diag,*) subname,'JRA55_bulk_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,'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,'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,'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,'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,'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,'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,'Qa',vmin,vmax | ||
|
||
endif ! dbug | ||
|
||
end subroutine Jra55_data_old | ||
|
||
!======================================================================= | ||
! | ||
! AOMIP shortwave forcing | ||
|
@@ -4403,7 +4165,7 @@ subroutine ocn_data_ncar(dt) | |
do iblk = 1, nblocks | ||
if (hm(i,j,iblk) == c1) then | ||
if (n == 2) sss (i,j,iblk) = work1(i,j,iblk) | ||
if (n == 3) hmix (i,j,iblk) = work1(i,j,iblk) | ||
if (n == 3) hmix (i,j,iblk) = max(mixed_layer_depth_default,work1(i,j,iblk)) | ||
if (n == 4) uocn (i,j,iblk) = work1(i,j,iblk) | ||
if (n == 5) vocn (i,j,iblk) = work1(i,j,iblk) | ||
if (n == 6) ss_tltx(i,j,iblk) = work1(i,j,iblk) | ||
|
@@ -4518,7 +4280,7 @@ subroutine ocn_data_oned | |
ss_tlty(:,:,:) = c0 | ||
frzmlt (:,:,:) = c0 ! freezing/melting potential (W/m^2) | ||
qdp (:,:,:) = c0 ! deep ocean heat flux (W/m^2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to fix the ocn_data_oned subroutine when we clean up the forcing module. sss probably shouldn't be hardwired either. We can discuss whether to get rid of this option completely (and just use Icepack) or keep it as an additional test for comparing with Icepack's test, or keep it to have netcdf available in a column configuration. |
||
hmix (:,:,:) = c20 ! ocean mixed layer depth | ||
hmix (:,:,:) = mixed_layer_depth_default ! ocean mixed layer depth | ||
|
||
end subroutine ocn_data_oned | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
CICE 6.1.4 | ||
CICE 6.2.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
days_per_year = 360 | ||
use_leap_years = .false. | ||
npt = 240 | ||
ice_ic = 'default' | ||
restart = .false. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
year_init = 2005 | ||
month_init = 4 | ||
day_init = 1 | ||
sec_init = 0 | ||
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx1/iced_gx1_v6.2005-04-01.nc' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, mainly as a reminder: We are making JRA the default, but the older forcing options are still available. Those will need to be deprecated via our process (not in this release).