Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbench mainf26 icepack #637

Merged
merged 18 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
aff740d
try to make icepack to compile. Try to preliminary fix the icepack r…
patrickscholz Oct 7, 2024
a66454e
add old icepack debug changes into ice_oce_coupling.F90
patrickscholz Oct 7, 2024
da877f3
switch defalt icepack update ocean fluxes to true
patrickscholz Oct 9, 2024
e62e2c2
make icepack restart work for the moment
patrickscholz Oct 9, 2024
2d0b474
add icepack bugfix from ancient debugging round in 2021, Problem in …
patrickscholz Oct 9, 2024
15a2ba4
make last changes so that icepack is fully volume conserving under z…
patrickscholz Oct 10, 2024
2efe5b0
add openmp loop in ice_oce_:coupling.F90, delete uneccessary comment …
patrickscholz Oct 11, 2024
cd374e7
fix icepack io_mean variable writing + fix and improve restart writi…
patrickscholz Oct 15, 2024
bfea5f1
add some comments
patrickscholz Oct 15, 2024
6951b11
sort and structure icepack io meandata output routine
patrickscholz Oct 16, 2024
1de84cd
make sure the io mean routine is able to write an array for the ncat…
patrickscholz Oct 16, 2024
dbb76f8
reduce number of def_nod_var subroutines, make ncat index an optional…
patrickscholz Oct 16, 2024
4a5d97d
fix the icepack netcdf restart, add additional restart variables, now…
patrickscholz Oct 18, 2024
4d344d9
Merge branch 'main' into workbench_mainf26_icepack
patrickscholz Oct 18, 2024
5801e27
fix minor issue
patrickscholz Oct 18, 2024
cb6e281
Merge branch 'workbench_mainf26_icepack' of https://github.com/FESOM/…
patrickscholz Oct 18, 2024
d9a4ae5
change default ICEPACK branch in download_icepack.sh from icepack_fes…
patrickscholz Oct 18, 2024
203a3f4
Merge branch 'main' into workbench_mainf26_icepack
JanStreffing Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/namelist.icepack
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
ustar_min = 0.0005
emissivity = 0.95
fbot_xfer_type = 'constant'
update_ocn_f = .false.
update_ocn_f = .true.
l_mpond_fresh = .false.
tfrz_option = 'linear_salt'
oceanmixed_ice = .true.
Expand Down
2 changes: 1 addition & 1 deletion config/namelist.icepack.cesm.ponds
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
ustar_min = 0.0005
emissivity = 0.95
fbot_xfer_type = 'constant'
update_ocn_f = .false.
update_ocn_f = .true.
l_mpond_fresh = .false.
tfrz_option = 'linear_salt'
oceanmixed_ice = .true.
Expand Down
74 changes: 54 additions & 20 deletions src/ice_oce_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,35 @@ subroutine oce_fluxes(ice, dynamics, tracers, partit, mesh)
!
#if defined (__icepack)

call icepack_to_fesom (nx_in=(myDim_nod2D+eDim_nod2D), &
aice_out=a_ice, &
vice_out=m_ice, &
vsno_out=m_snow, &
fhocn_tot_out=net_heat_flux, &
fresh_tot_out=fresh_wa_flux, &
fsalt_out=real_salt_flux, &
dhi_dt_out=thdgrsn, &
dhs_dt_out=thdgr, &
evap_ocn_out=evaporation )

heat_flux(:) = - net_heat_flux(:)
water_flux(:) = - (fresh_wa_flux(:)/1000.0_WP) - runoff(:)

! Evaporation
evaporation(:) = - evaporation(:) / 1000.0_WP
ice_sublimation(:) = 0.0_WP
call icepack_to_fesom (nx_in = (myDim_nod2D+eDim_nod2D), &
aice_out = a_ice, &
vice_out = m_ice, &
vsno_out = m_snow, &
fhocn_tot_out = net_heat_flux, &
fresh_tot_out = fresh_wa_flux, &
fsalt_out = real_salt_flux, &
dhs_dt_out = thdgrsn, &
dhi_dt_out = thdgr, &
evap_ocn_out = evaporation, &
evap_out = ice_sublimation )

!$OMP PARALLEL DO
do n=1, myDim_nod2d+eDim_nod2d
! Heat flux
heat_flux(n) = - net_heat_flux(n)

! Freshwater flux (convert units from icepack to fesom)
water_flux(n) = - (fresh_wa_flux(n) * inv_rhowat) - runoff(n)

! Evaporation (convert units from icepack to fesom)
evaporation(n) = - evaporation(n) * (1.0_WP - a_ice(n)) * inv_rhowat

! Ice-Sublimation is added to to the freshwater in icepack --> see
! icepack_therm_vertical.90 --> subroutine thermo_vertical(...): Line: 453
! freshn = freshn + evapn - (rhoi*dhi + rhos*dhs) / dt , evapn==sublimation
ice_sublimation(n) = - ice_sublimation(n) * inv_rhowat
end do
!$OMP END PARALLEL DO

call init_flux_atm_ocn()

Expand Down Expand Up @@ -515,12 +527,31 @@ subroutine oce_fluxes(ice, dynamics, tracers, partit, mesh)
! enforce the total freshwater/salt flux be zero
! 1. water flux ! if (.not. use_virt_salt) can be used!
! we conserve only the fluxes from the database plus evaporation.
! ICEPACK: adds rain, snow and evap is based on the newly formed ice
! concentration (a_ice). In our standard ice model rain, snow and evap is
! added based on the ice concentration of the previous time step (a_ice_old)
! So for the proper balancing of snow the proper aice has to be choosen
! -icepack_therm_itd.F90 --> subroutine icepack_step_therm2(...)
! fresh = fresh + frain*aice
! -icedrv_step.F90: subroutine ocn_mixed_layer_icepack(...
! fresh_tot = fresh + (-evap_ocn + frain + fsnow)*(c1-aice)
! At the end all rain is added to the ocean, only snow needs to be
! scaled with (1-aice )
! -Ice-Sublimation is not added to evap in icepack, therefor we dont need
! to compensate for it the ice2atmos subplimation does not contribute
! to the freshwater flux into the ocean

!$OMP PARALLEL DO
do n=1, myDim_nod2D+eDim_nod2D
flux(n) = evaporation(n) &
flux(n) = evaporation(n) &
-ice_sublimation(n) & ! the ice2atmos subplimation does not contribute to the freshwater flux into the ocean
+prec_rain(n) &
+prec_rain(n) &
#if defined (__icepack)
+prec_snow(n)*(1.0_WP-a_ice(n)) &
#else
+prec_snow(n)*(1.0_WP-a_ice_old(n)) &
#endif

#if defined (__oasis) || defined (__ifsinterface)
+residualifwflx(n) & ! balance residual ice flux only in coupled case
#endif
Expand Down Expand Up @@ -614,6 +645,8 @@ subroutine oce_fluxes(ice, dynamics, tracers, partit, mesh)
!$OMP END PARALLEL DO
end if


!___________________________________________________________________________
!---fwf-code-begin
if(use_landice_water) then
!$OMP PARALLEL DO
Expand All @@ -622,7 +655,8 @@ subroutine oce_fluxes(ice, dynamics, tracers, partit, mesh)
end do
!$OMP END PARALLEL DO
end if


!___________________________________________________________________________
if(lwiso .and. use_landice_water) then
!$OMP PARALLEL DO
do n=1, myDim_nod2D+eDim_nod2D
Expand Down
3 changes: 2 additions & 1 deletion src/icepack_drivers/download_icepack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ DIR="./Icepack"
if [ ! -d "$DIR" ]; then
git clone https://github.com/lzampier/Icepack.git
cd $DIR
git checkout icepack_fesom2
# git checkout icepack_fesom2
git checkout icepack_fesom2_bugfix
fi
4 changes: 4 additions & 0 deletions src/icepack_drivers/icedrv_allocate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ subroutine alloc_flux
opening(nx) , & ! rate of opening due to divergence/shear (1/s)
dhi_dt(nx) , & ! ice volume tendency due to thermodynamics (m/s)
dhs_dt(nx) , & ! snow volume tendency due to thermodynamics (m/s)
dhi_t_dt(nx) , & ! ice volume tendency due to thermodynamics (m/s)
dhs_t_dt(nx) , & ! snow volume tendency due to thermodynamics (m/s)
dhi_r_dt(nx) , & ! ice volume tendency due to ridging (m/s)
dhs_r_dt(nx) , & ! snow volume tendency due to ridging (m/s)
dardg1ndt(nx,ncat), & ! rate of area loss by ridging ice (1/s)
dardg2ndt(nx,ncat), & ! rate of area gain by new ridges (1/s)
dvirdgndt(nx,ncat), & ! rate of ice volume ridged (m/s)
Expand Down
Loading
Loading