-
Notifications
You must be signed in to change notification settings - Fork 154
Saltflux option for CICE #799
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
Changes from all commits
c489483
9db5da4
490b259
0d23ccd
675670d
758d2ac
853b6ec
df51c68
b13b728
9bb0281
33ea462
842d5c6
fbf9d59
d88e71e
ba6fe8a
71cf0fb
df5573f
4f8cf7e
8b1c232
f19faa7
3363e83
34dbeed
6201214
38103c5
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 |
|---|---|---|
|
|
@@ -17,11 +17,11 @@ module ice_init | |
| use ice_constants, only: c0, c1, c2, c3, c5, c12, p2, p3, p5, p75, p166, & | ||
| cm_to_m | ||
| use ice_exit, only: abort_ice | ||
| use ice_fileunits, only: nu_nml, nu_diag, nu_diag_set, nml_filename, diag_type, & | ||
| use ice_fileunits, only: nu_nml, nu_diag, nml_filename, diag_type, & | ||
| ice_stdout, get_fileunit, release_fileunit, bfbflag, flush_fileunit, & | ||
| ice_IOUnitsMinUnit, ice_IOUnitsMaxUnit | ||
| #ifdef CESMCOUPLED | ||
| use ice_fileunits, only: inst_suffix | ||
| use ice_fileunits, only: inst_suffix, nu_diag_set | ||
| #endif | ||
| use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted | ||
| use icepack_intfc, only: icepack_aggregate | ||
|
|
@@ -151,7 +151,7 @@ subroutine input_data | |
| kitd, kcatbound, ktransport | ||
|
|
||
| character (len=char_len) :: shortwave, albedo_type, conduct, fbot_xfer_type, & | ||
| tfrz_option, frzpnd, atmbndy, wave_spec_type, snwredist, snw_aging_table, & | ||
| tfrz_option, saltflux_option, frzpnd, atmbndy, wave_spec_type, snwredist, snw_aging_table, & | ||
| capping_method | ||
|
|
||
| logical (kind=log_kind) :: calc_Tsfc, formdrag, highfreq, calc_strair, wave_spec, & | ||
|
|
@@ -163,7 +163,7 @@ subroutine input_data | |
| integer (kind=int_kind) :: numin, numax ! unit number limits | ||
|
|
||
| integer (kind=int_kind) :: rplvl, rptopo | ||
| real (kind=dbl_kind) :: Cf, ksno, puny | ||
| real (kind=dbl_kind) :: Cf, ksno, puny, ice_ref_salinity | ||
| character (len=char_len) :: abort_list | ||
| character (len=128) :: tmpstr2 | ||
|
|
||
|
|
@@ -260,6 +260,7 @@ subroutine input_data | |
| highfreq, natmiter, atmiter_conv, calc_dragio, & | ||
| ustar_min, emissivity, iceruf, iceruf_ocn, & | ||
| fbot_xfer_type, update_ocn_f, l_mpond_fresh, tfrz_option, & | ||
| saltflux_option,ice_ref_salinity, & | ||
| oceanmixed_ice, restore_ice, restore_ocn, trestore, & | ||
| precip_units, default_season, wave_spec_type,nfreq, & | ||
| atm_data_type, ocn_data_type, bgc_data_type, fe_data_type, & | ||
|
|
@@ -497,6 +498,8 @@ subroutine input_data | |
| precip_units = 'mks' ! 'mm_per_month' or | ||
| ! 'mm_per_sec' = 'mks' = kg/m^2 s | ||
| tfrz_option = 'mushy' ! freezing temp formulation | ||
| saltflux_option = 'constant' ! saltflux calculation | ||
| ice_ref_salinity = 4.0_dbl_kind ! Ice reference salinity for coupling | ||
| oceanmixed_ice = .false. ! if true, use internal ocean mixed layer | ||
| wave_spec_type = 'none' ! type of wave spectrum forcing | ||
| nfreq = 25 ! number of wave frequencies | ||
|
|
@@ -758,8 +761,8 @@ subroutine input_data | |
| ! each task gets unique ice log filename when if test is true, for debugging | ||
| if (1 == 0) then | ||
| call get_fileUnit(nu_diag) | ||
| write(tmpstr,'(a,i4.4)') "ice.log.task_",my_task | ||
| open(nu_diag,file=tmpstr) | ||
| write(tmpstr2,'(a,i4.4)') "ice.log.task_",my_task | ||
| open(nu_diag,file=tmpstr2) | ||
| endif | ||
| end if | ||
| if (trim(ice_ic) /= 'default' .and. & | ||
|
|
@@ -979,6 +982,8 @@ subroutine input_data | |
| call broadcast_scalar(wave_spec_file, master_task) | ||
| call broadcast_scalar(nfreq, master_task) | ||
| call broadcast_scalar(tfrz_option, master_task) | ||
| call broadcast_scalar(saltflux_option, master_task) | ||
| call broadcast_scalar(ice_ref_salinity, master_task) | ||
| call broadcast_scalar(ocn_data_format, master_task) | ||
| call broadcast_scalar(bgc_data_type, master_task) | ||
| call broadcast_scalar(fe_data_type, master_task) | ||
|
|
@@ -1414,6 +1419,12 @@ subroutine input_data | |
| write(nu_diag,*) subname//' WARNING: For consistency, set tfrz_option = mushy' | ||
| endif | ||
| endif | ||
| if (ktherm == 1 .and. trim(saltflux_option) /= 'constant') then | ||
|
Contributor
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. should this be an error or just a warning that nobody will see?
Contributor
Author
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. I'm basically going with the example of tfrz_option here. It is not advisable to use ktherm = 1 and saltflux_option /= 'constant', but maybe people could do it if they wanted.
Contributor
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. fine by me, was just asking. |
||
| if (my_task == master_task) then | ||
| write(nu_diag,*) subname//' WARNING: ktherm = 1 and saltflux_option = ',trim(saltflux_option) | ||
| write(nu_diag,*) subname//' WARNING: For consistency, set saltflux_option = constant' | ||
| endif | ||
| endif | ||
| !tcraig | ||
| if (ktherm == 1 .and. .not.sw_redist) then | ||
| if (my_task == master_task) then | ||
|
|
@@ -1974,6 +1985,10 @@ subroutine input_data | |
| write(nu_diag,*) ' WARNING: will impact ocean forcing interaction' | ||
| write(nu_diag,*) ' WARNING: coupled forcing will be modified by mixed layer routine' | ||
| endif | ||
| write(nu_diag,1030) ' saltflux_option = ', trim(saltflux_option) | ||
| if (trim(saltflux_option) == 'constant') then | ||
| write(nu_diag,1002) ' ice_ref_salinity = ',ice_ref_salinity | ||
| endif | ||
| if (trim(tfrz_option) == 'minus1p8') then | ||
| tmpstr2 = ' : constant ocean freezing temperature (-1.8C)' | ||
| elseif (trim(tfrz_option) == 'linear_salt') then | ||
|
|
@@ -2378,6 +2393,7 @@ subroutine input_data | |
| wave_spec_type_in = wave_spec_type, & | ||
| wave_spec_in=wave_spec, nfreq_in=nfreq, & | ||
| tfrz_option_in=tfrz_option, kalg_in=kalg, fbot_xfer_type_in=fbot_xfer_type, & | ||
| saltflux_option_in=saltflux_option, ice_ref_salinity_in=ice_ref_salinity, & | ||
| Pstar_in=Pstar, Cstar_in=Cstar, iceruf_in=iceruf, iceruf_ocn_in=iceruf_ocn, calc_dragio_in=calc_dragio, & | ||
| windmin_in=windmin, drhosdwind_in=drhosdwind, & | ||
| rsnw_fall_in=rsnw_fall, rsnw_tmax_in=rsnw_tmax, rhosnew_in=rhosnew, & | ||
|
|
@@ -2793,7 +2809,7 @@ subroutine set_state_var (nx_block, ny_block, & | |
| indxi, indxj ! compressed indices for cells with aicen > puny | ||
|
|
||
| real (kind=dbl_kind) :: & | ||
| Tsfc, sum, hbar, abar, puny, rhos, Lfresh, rad_to_deg, rsnw_fall, dist_ratio | ||
| Tsfc, sum, hbar, abar, puny, rhos, Lfresh, rad_to_deg, rsnw_fall, dist_ratio, Tffresh | ||
|
|
||
| real (kind=dbl_kind), dimension(ncat) :: & | ||
| ainit, hinit ! initial area, thickness | ||
|
|
@@ -2835,7 +2851,7 @@ subroutine set_state_var (nx_block, ny_block, & | |
| nt_smice_out=nt_smice, nt_smliq_out=nt_smliq, & | ||
| nt_rhos_out=nt_rhos, nt_rsnw_out=nt_rsnw) | ||
| call icepack_query_parameters(rhos_out=rhos, Lfresh_out=Lfresh, puny_out=puny, & | ||
| rad_to_deg_out=rad_to_deg, rsnw_fall_out=rsnw_fall) | ||
| rad_to_deg_out=rad_to_deg, rsnw_fall_out=rsnw_fall, Tffresh_out=Tffresh) | ||
| call icepack_query_parameters(secday_out=secday, pi_out=pi) | ||
| call icepack_warnings_flush(nu_diag) | ||
| if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & | ||
|
|
@@ -3073,7 +3089,12 @@ subroutine set_state_var (nx_block, ny_block, & | |
| do i = ilo, ihi | ||
| if (tmask(i,j)) then | ||
| ! place ice in high latitudes where ocean sfc is cold | ||
| #ifdef CESMCOUPLED | ||
| ! Option to use Tair instead. | ||
| if ( (Tair (i,j) <= Tffresh) .and. & | ||
| #else | ||
| if ( (sst (i,j) <= Tf(i,j)+p2) .and. & | ||
| #endif | ||
| (TLAT(i,j) < edge_init_sh/rad_to_deg .or. & | ||
| TLAT(i,j) > edge_init_nh/rad_to_deg) ) then | ||
| icells = icells + 1 | ||
|
|
||
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.
Looks like you could reuse work1 here rather than add new array, work2.
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.
Maybe. I thought they needed to be independent.
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.
In this code, we do not need work2, but in the print_points code we do. The array work2 is used in a number of places, so it is not really saving us memory.
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.
OK, it just looks like work2 was added in init_mass_diags just for the new salt diagnostic. work2 must exist separately in print_points and elsewhere.