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

Wombat #47

Merged
merged 9 commits into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 40 additions & 35 deletions drivers/auscom/cpl_arrays_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,71 @@ module cpl_arrays_setup
! It's designed to include the following 'possible' coupling fields at the
! air-ice-sea surface:
!
! Further fields may be handled here. As of June 2020 the maximum number of fields passed from 1 component to another is 32 and is
! set in module cpl_parameters. The actual number passed is now determined at run time via namelists.
!
! A> atm==>ice
!
! (1) 2m air temp (K) tair0
! (2) 10m 'zonal' wind speed (m/s) uwnd0
! (3) 10m 'meridional' wind speed (m/s) vwnd0
! (4) shortwave radiation (down, J/m^2) swflx0
! (5) longwave radiation (down, J/m^2) lwflx0
! (6) 2m air specific humidity (kg/kg) qair0
! (7) rainfall rate (kg/m^2/s) rain0
! (1) 2m air temp (K) tair0
! (2) 10m 'zonal' wind speed (m/s) uwnd0
! (3) 10m 'meridional' wind speed (m/s) vwnd0
! (4) shortwave radiation (down, J/m^2) swflx0
! (5) longwave radiation (down, J/m^2) lwflx0
! (6) 2m air specific humidity (kg/kg) qair0
! (7) rainfall rate (kg/m^2/s) rain0
! (8) snowfall rate (kg/m^2/s) snow0
! (9) pressure (Pa) press0
! (10)runof (kg/m^2/s) runof0
! (9) pressure (Pa) press0
! (10)runof (kg/m^2/s) runof0
! (11)calving (kg/m^2/s) calv0
!
! B> ocn==>ice
!
! (1) sea surface temperature (K) ssto
! (2) sea surface salinity (psu) ssso
! (3) zonal water speed (m/s) ssuo
! (4) meridional water speed (m/s) ssvo
! (5) sea surface gradient (zonal) (m/m) sslx
! (6) sea surface gradient (meridional)(m/m) ssly
! (7) potential ice frm/mlt heatflux (W/m^2) pfmice
! (1) sea surface temperature (K) ssto
! (2) sea surface salinity (psu) ssso
! (3) zonal water speed (m/s) ssuo
! (4) meridional water speed (m/s) ssvo
! (5) sea surface gradient (zonal) (m/m) sslx
! (6) sea surface gradient (meridional)(m/m) ssly
! (7) potential ice frm/mlt heatflux (W/m^2) pfmice
!
! D> ice==>ocn
!
! (1) ice-ocean stress, x-direction (kg/m s^2) iostrsu
! (2) ice-ocean stress, y-direction (kg/m s^2) iostrsv
! (3) fresh water flux to ocean--rain (kg/m^2/s) iorain
! (4) fresh water flux to ocean--snow (kg/m^2/s) iosnow
! (5) salt flux to ocean (kg/m^2/s) iostflx
! (6) 'net' heat flux to ocean (W/m^2) iohtflx
! (1) ice-ocean stress, x-direction (kg/m s^2) iostrsu
! (2) ice-ocean stress, y-direction (kg/m s^2) iostrsv
! (3) fresh water flux to ocean--rain (kg/m^2/s) iorain
! (4) fresh water flux to ocean--snow (kg/m^2/s) iosnow
! (5) salt flux to ocean (kg/m^2/s) iostflx
! (6) 'net' heat flux to ocean (W/m^2) iohtflx
! *(note word 'net' is misleading!) it is actually ice
! *'melt' heatflux into ocean. (ref: ice_coupling.F,
! *it says:
! *'buffs(n,index_i2c_Fioi_melth) = fhnet(i,j)
! * ! hf from melting'
! (7) shortwave penetrating to ocean (W/m^2) ioswflx
! (7) shortwave penetrating to ocean (W/m^2) ioswflx
! Also, we let the following 'atmospheric fluxes'
! (some maybe calculated in cice) be passed into ocean:
! (8) latent heat flux (W/m^2, positive out of ocean) ioqflux
! (9) sensible heat flux (W/m^2, postive out of ocean ioshflx
! (9) sensible heat flux (W/m^2, postive out of ocean ioshflx
!--- note sensible/latent heatfluxes are calculated in cice being
! positive into ocean! they must change sign before sent to
! mom4 (which requires these 2 item as positive out of ocean!)
! this is done in routine" get_i2o_fluxes"
!
!(10) long wave radiation iolwflx
!(11) runoff iorunof
!(12) pressure iopress
!(13) ice concentration (fraction) ioaice
!(10) long wave radiation iolwflx
!(11) runoff iorunof
!(12) pressure iopress
!(13) ice concentration (fraction) ioaice
!
! Seperate ice melting/forcation associated water fluxes from the rainfall field:
!
!(14) ice melt waterflux iomelt
!(15) ice form waterflux ioform
!(16) land ice waterflux iolicefw
!(17) land ice heatflux iolicefh
!(14) ice melt waterflux iomelt
!(15) ice form waterflux ioform
!(16) land ice waterflux iolicefw
!(17) land ice heatflux iolicefh
!(18) 10m wind speeds iownd10
!
!
! 18 in, 18 out => thus we set jpfldout=18, jpfldin=18 (in cpl_parameters)!

!
!----------------------------------------------------------------------------
!Note:
Expand Down Expand Up @@ -100,11 +105,11 @@ module cpl_arrays_setup
real(kind=dbl_kind),dimension(:,:,:), allocatable :: & !to ocn (time averaged)
iostrsu, iostrsv, iorain, iosnow, iostflx, iohtflx, ioswflx &
,ioqflux, ioshflx, iolwflx, iorunof, iopress, ioaice &
,iomelt, ioform, iolicefw, iolicefh
,iomelt, ioform, iolicefw, iolicefh, iownd
real(kind=dbl_kind),dimension(:,:,:), allocatable :: & !to ocn (temporary)
tiostrsu, tiostrsv, tiorain, tiosnow, tiostflx, tiohtflx, tioswflx &
,tioqflux, tioshflx, tiolwflx, tiorunof, tiopress, tioaice &
,tiomelt, tioform, tiolicefw, tiolicefh
,tiomelt, tioform, tiolicefw, tiolicefh, tiownd

! other stuff
real(kind=dbl_kind),dimension(:,:,:), allocatable :: &
Expand Down
11 changes: 11 additions & 0 deletions drivers/auscom/cpl_forcing_handler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ subroutine nullify_i2o_fluxes()
ioaice(:,:,:) = 0.0
iomelt(:,:,:) = 0.0
ioform(:,:,:) = 0.0
iownd(:,:,:) = 0.0
iolicefw(:,:,:) = 0.0
iolicefh(:,:,:) = 0.0

Expand All @@ -70,6 +71,7 @@ subroutine tavg_i2o_fluxes
!!!
iomelt (:,:,:) = iomelt (:,:,:) + tiomelt (:,:,:)*coef_ic
ioform (:,:,:) = ioform (:,:,:) + tioform (:,:,:)*coef_ic
iownd (:,:,:) = iownd (:,:,:) + tiownd (:,:,:)*coef_ic
iolicefw (:,:,:) = iolicefw (:,:,:) + tiolicefw (:,:,:)*coef_ic
iolicefh (:,:,:) = iolicefh (:,:,:) + tiolicefh (:,:,:)*coef_ic

Expand Down Expand Up @@ -237,6 +239,8 @@ subroutine get_time0_i2o_fields(fname)
iomelt = vwork
elseif (trim(fields_to_ocn(i)) == 'form_io') then
ioform = vwork
elseif (trim(fields_to_ocn(i)) == 'wnd10_io') then
iownd = vwork
elseif (trim(fields_to_ocn(i)) == 'licefw_io') then
iolicefw = vwork
elseif (trim(fields_to_ocn(i)) == 'licefh_io') then
Expand Down Expand Up @@ -423,6 +427,8 @@ subroutine save_time0_i2o_fields(fname, nstep)
vwork = iolicefw
elseif (trim(fields_to_ocn(i)) == 'licefh_io') then
vwork = iolicefh
elseif (trim(fields_to_ocn(i)) == 'wnd10_io') then
vwork = iownd
else
call abort_ice('ice: bad save array name '//trim(fields_to_ocn(i)))
endif
Expand Down Expand Up @@ -786,6 +792,9 @@ subroutine get_i2o_fluxes
tiomelt(:,:,:) = max(0.0,fresh(:,:,:))
!15) ice form waterflux:
tioform(:,:,:) = min(0.0,fresh(:,:,:))
!16 10m wind. To mask or not to mask?
tiownd(:,:,:) = sqrt(uatm(:,:,:)**2 + vatm(:,:,:)**2)


return
end subroutine get_i2o_fluxes
Expand Down Expand Up @@ -1210,6 +1219,8 @@ subroutine check_i2o_fields(ncfile,nstep, scale)
if (my_task == 0) call write_nc2D(ncid, 'iomelt', gwork, 2, nx_global,ny_global,currstep,ilout=il_out)
call gather_global(gwork, scale*ioform, master_task, distrb_info)
if (my_task == 0) call write_nc2D(ncid, 'ioform', gwork, 2, nx_global,ny_global,currstep,ilout=il_out)
call gather_global(gwork, scale*iownd, master_task, distrb_info)
if (my_task == 0) call write_nc2D(ncid, 'iownd', gwork, 2, nx_global,ny_global,currstep,ilout=il_out)

if (my_task == 0) call ncheck(nf_close(ncid), 'check_i2o_fields: nf_close')

Expand Down
8 changes: 8 additions & 0 deletions drivers/auscom/cpl_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
allocate (iolicefw (nx_block, ny_block, max_blocks)); iolicefw(:,:,:) = 0
allocate (iolicefh (nx_block, ny_block, max_blocks)); iolicefh(:,:,:) = 0

allocate (iownd (nx_block, ny_block, max_blocks)); iownd(:,:,:) = 0

allocate (tiostrsu(nx_block, ny_block, max_blocks)); tiostrsu(:,:,:) = 0
allocate (tiostrsv(nx_block, ny_block, max_blocks)); tiostrsv(:,:,:) = 0
allocate (tiorain(nx_block, ny_block, max_blocks)); tiorain(:,:,:) = 0
Expand All @@ -328,6 +330,8 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
allocate (tiomelt(nx_block, ny_block, max_blocks)); tiomelt(:,:,:) = 0
allocate (tioform(nx_block, ny_block, max_blocks)); tioform(:,:,:) = 0

allocate (tiownd (nx_block, ny_block, max_blocks)); tiownd(:,:,:) = 0

allocate (tiolicefw(nx_block, ny_block, max_blocks)); tiolicefw(:,:,:) = 0
allocate (tiolicefh(nx_block, ny_block, max_blocks)); tiolicefh(:,:,:) = 0

Expand Down Expand Up @@ -630,6 +634,8 @@ subroutine into_ocn(isteps, scale)
call pack_coupling_array(iolicefw*scale, work)
elseif (trim(fields_to_ocn(i)) == 'licefh_io') then
call pack_coupling_array(iolicefh*scale, work)
elseif (trim(fields_to_ocn(i)) == 'wnd10_io') then
call pack_coupling_array(iownd*scale, work)
else
call abort_ice('ice: bad coupling array name '//fields_to_ocn(i))
endif
Expand Down Expand Up @@ -695,6 +701,7 @@ subroutine coupler_termination
deallocate (tiostrsu, tiostrsv, tiorain, tiosnow, tiostflx, tiohtflx, tioswflx, &
tioqflux, tiolwflx, tioshflx, tiorunof, tiolicefw, tiolicefh, tiopress)
deallocate (iomelt, ioform, tiomelt, tioform)
deallocate (iownd, tiownd)
deallocate (gwork, vwork, sicemass)
!
! PSMILe termination
Expand Down Expand Up @@ -744,6 +751,7 @@ subroutine write_boundary_checksums(time)
print*, '[ice chksum] ioaice:', sum(ioaice(isc:iec, jsc:jec, 1))
print*, '[ice chksum] iomelt:', sum(iomelt(isc:iec, jsc:jec, 1))
print*, '[ice chksum] ioform:', sum(ioform(isc:iec, jsc:jec, 1))
print*, '[ice chksum] iownd:', sum(iownd(isc:iec, jsc:jec, 1))
print*, '[ice chksum] iorunof:', sum(iorunof(isc:iec, jsc:jec, 1))
print*, '[ice chksum] iolicefw:', sum(iolicefw(isc:iec, jsc:jec, 1))
print*, '[ice chksum] iolicefh:', sum(iolicefh(isc:iec, jsc:jec, 1))
Expand Down
2 changes: 1 addition & 1 deletion drivers/auscom/cpl_netcdf_setup.F90
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ subroutine create_ncfile(ncfile, ncid, ii, jj, kk, ll, ilout)
'create_ncfile: nf_def_dim nx')

!end of the definition phase
call ncheck(nf_enddef(ncid), 'create_ncfile: nf_enddef')
call ncheck(nf__enddef(ncid,1028,512,512,512), 'create_ncfile: nf__enddef')

!close NetCDF file
!call ncheck(nf_close(ncid))
Expand Down