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

Merge cgridDEV branch including C grid implementation and other fixes #715

Merged
merged 113 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
1cc4372
initial implementation of N+E LON/LAT variables
apcraig Oct 30, 2021
7f73890
add dx,dy,area,mask for N and E and write to history files
apcraig Oct 31, 2021
87df8d4
add grid_average_X2Y method to average fields from one grid to another
apcraig Nov 2, 2021
f37f4fd
add gridavgchk, add blockall, add set_nml.dwblockall
apcraig Nov 4, 2021
262eb60
add X2YS and update gridavgchk
apcraig Nov 5, 2021
6bffe27
add grid_system namelist, update computation of areas to use local da…
apcraig Nov 5, 2021
5de9a2c
update documentation
apcraig Nov 5, 2021
e0b1b19
add CICE_Cgrid.pdf
apcraig Nov 5, 2021
bf35e78
update documentation
apcraig Nov 5, 2021
f7e33f8
update documentation
apcraig Nov 5, 2021
a427504
update documentation
apcraig Nov 5, 2021
dc72321
update documentation
apcraig Nov 5, 2021
ce5461d
update documentation
apcraig Nov 5, 2021
b58e385
update documentation
apcraig Nov 5, 2021
4cd4039
update pio history_write for new grids
apcraig Nov 8, 2021
63a1f1f
update history coords and attributes
apcraig Nov 9, 2021
e0914cc
switch to six velocity variables (uvel, vvel, uvele, vvele, uveln, vv…
apcraig Nov 11, 2021
c6258dc
Merge pull request #1 from apcraig/cgridA
apcraig Nov 12, 2021
8f2e634
Added strain_rates_T for calc of strain rates at the T point
JFLemieux73 Nov 15, 2021
bfdef30
Additional CD grid variable (#2)
dabail10 Nov 15, 2021
58c20f7
fix recent bug preventing compiling (#5)
apcraig Nov 15, 2021
50d67f8
ice_dyn_shared: add 'viscous_coeffs_and_rep_pressure_T' subroutine (#3)
phil-blain Nov 16, 2021
5090796
Add stress terms to history for N and E grids. (#4)
dabail10 Nov 16, 2021
35dd3f8
Fix diagnostics for CD grid (#6)
dabail10 Nov 16, 2021
63d0f48
Remove CD history variables from namelist (#7)
dabail10 Nov 16, 2021
34a3ada
Landmaskb (#8)
eclare108213 Nov 16, 2021
e9aa132
Subroutines for CD-grid rheology (#10)
JFLemieux73 Nov 16, 2021
1b4c03e
Add symmetry test and gridsys_suite (#11)
apcraig Nov 16, 2021
97791af
Cgrid dev forcing (#13)
daveh150 Nov 17, 2021
2f65ca8
Additional CD variables for the EVP dynamics (#14)
dabail10 Nov 17, 2021
5435aba
Change some indents and change 0 to c0. (#15)
dabail10 Nov 17, 2021
256faed
Add icespd and icedir at U, E, and N points (#16)
dabail10 Nov 17, 2021
0aeee2c
New div_stress subroutine (#18)
JFLemieux73 Nov 17, 2021
838bf30
Changes in ice_dyn* are interpolation of uvelE/vvelN to B grid. ice_t…
TillRasmussen Nov 17, 2021
052caab
Bug fix for missing allocation of CD variables (#19)
dabail10 Nov 17, 2021
256c3dc
fix advection none setup for multiproc runs, remove obsolete box2001 …
apcraig Nov 18, 2021
b401c08
Compute seabed stress at CD-grid locations (#20)
phil-blain Nov 18, 2021
e3112eb
Add some variables for CD discretization (#21)
dabail10 Nov 18, 2021
249639a
Add halo updates on uvelE, vvelE, uvelN, and vvelN (#23)
dabail10 Nov 18, 2021
8dc3d0b
Compute velocities at CD-grid locations (#24)
phil-blain Nov 18, 2021
216acf8
Strain_rates_U subroutine (#26)
JFLemieux73 Nov 18, 2021
028037d
Cgrid update box tests (#25)
daveh150 Nov 18, 2021
f91adf0
Fix some initialization of CD variables. (#27)
dabail10 Nov 19, 2021
bc38c07
Add CD-grid stress arrays (#28)
phil-blain Nov 19, 2021
0025eae
Stress_U subroutine (#29)
JFLemieux73 Nov 19, 2021
3e1ab26
Add calls to dyn_finish for CD grid (#30)
dabail10 Nov 19, 2021
e2658d1
corrections to boxnodyn test: run dynamics with zero forcing (#31)
eclare108213 Nov 19, 2021
d4acb36
ifdef out the CD stress restart read to allow usage of B grid restart…
apcraig Nov 19, 2021
f46e35e
Add earear and narear (#35)
dabail10 Nov 20, 2021
922e672
div_stress calls and bug correction (#34)
JFLemieux73 Nov 20, 2021
bf34414
cicedynB: fix typos in abort messages (#36)
phil-blain Nov 20, 2021
207be2d
Add present on strocnyT (#37)
dabail10 Nov 20, 2021
c308719
quick fix for uninitialized variables (#38)
apcraig Nov 20, 2021
c4e0204
umaskCD and more (#33)
TillRasmussen Nov 24, 2021
9e6e8f3
Added boxnodyn tests to gridsys_suite.ts. Also added machinery to sub…
daveh150 Nov 24, 2021
c2c0c4a
Inialize uvel, vvel at every substep (#43)
dabail10 Nov 29, 2021
54e5c34
Update to Consortium #162aee9, update scripts (#44)
apcraig Nov 30, 2021
cc0e716
Modif strain u (#45)
JFLemieux73 Nov 30, 2021
a141535
turn off OMP around seabed stress, causes aborts on cheyenne with pgi…
apcraig Dec 1, 2021
f128ade
Cgrid debug (#42)
TillRasmussen Dec 2, 2021
0809cde
Add grid_ocn, grid_atm feature (#47)
apcraig Dec 16, 2021
bd59fb0
Fix a bug with dyn_prep2. (#48)
dabail10 Dec 22, 2021
e639643
Dynhalo (#49)
dabail10 Jan 25, 2022
311302a
new box symmetry tests and coriolis=zero (#50)
JFLemieux73 Jan 25, 2022
14f42ab
Add gbox12 and ice_data_type='smallblock' (#51)
apcraig Jan 25, 2022
94618ea
New subroutines stepu_Cgrid and stepv_Cgrid (#52)
JFLemieux73 Feb 3, 2022
5218435
- Implement support for grid_ice = "C". Currently bit-for-bit with "…
apcraig Feb 4, 2022
c22f906
calls for stepu,v_Cgrid and avg of uvelE at N point and vvelN at E po…
JFLemieux73 Feb 7, 2022
e01b2e8
Modify uniform atm/ice stress formulation, multiple by aiu (#55)
apcraig Feb 7, 2022
faa33be
Restarts for C and D (#56)
dabail10 Feb 9, 2022
00c43c8
New subroutine for viscous coeff at U point (#58)
JFLemieux73 Feb 9, 2022
b5dc5f3
Simplify/update setup of rectangular configurations (#57)
apcraig Feb 9, 2022
d9affd6
Change averaging for C grid. (#59)
dabail10 Feb 9, 2022
08d8730
Choice of visc coefficient method in namelist (#60)
JFLemieux73 Feb 10, 2022
09238c7
Add new geometries and tests (#61)
apcraig Feb 11, 2022
52a7054
fix bugs in binary and pio2 updates (#62)
apcraig Mar 2, 2022
e1394ef
deltamin now defined in ice_in (#63)
JFLemieux73 Mar 5, 2022
6534048
Update cgridDEV to main #8d7314f (CICE6.3.1 release) (#64)
apcraig Mar 8, 2022
21768d8
Fix box2001 forcing, restart fields on land, bathymetry default value…
apcraig Mar 10, 2022
4bf2611
- Work around a couple C/CD issues, https://github.com/CICE-Consortiu…
apcraig Mar 14, 2022
c5d3a71
- Fix query_field error, fixes C/CD restart error
apcraig Mar 14, 2022
762b655
Merge pull request #66 from apcraig/cgtestI
apcraig Mar 15, 2022
7a2d071
Refactor viscous_coeffs_and_rep_pressure, rename ecy to elasticDamp a…
apcraig Mar 15, 2022
97806bc
split if block sections for C and CD in evp for further cleanup (#68)
apcraig Mar 15, 2022
5d5a7e0
Create new stressC_T and stressC_U routines (#69)
dabail10 Mar 15, 2022
edede9b
Add shear strain rate code (#70)
JFLemieux73 Mar 15, 2022
ff8fb69
Change restart for C-grid (#71)
dabail10 Mar 15, 2022
8638cb2
Make some arguments optional in C dyn methods (#72)
apcraig Mar 15, 2022
012e21b
- Turn on new calls and use shrU (#73)
apcraig Mar 16, 2022
67b25a4
Rename stress_T and stress_U to stressCD_T and stressCD_U (#74)
apcraig Mar 16, 2022
1e041db
Finish cleanup of strain_rates, rename step and visc subroutines (#76)
apcraig Mar 17, 2022
c864473
Added comments: ref of Bouillon 2009, 2013, Hunke 2002 and Kimmritz 2…
JFLemieux73 Mar 17, 2022
5f3ea0c
Update master_list.bib (#77)
dabail10 Mar 17, 2022
6bfde63
Removed multiplication by uvm (not needed) in strain_rates_U (#78)
JFLemieux73 Mar 17, 2022
3008a24
Renamed visc_coeff_method to visc_method and visc coeff (comments) to…
JFLemieux73 Mar 17, 2022
2fb3310
update to include uarea (#80)
TillRasmussen Mar 17, 2022
de154be
Update dyn C/CD halo updates to mask and bundle fields (#81)
apcraig Mar 19, 2022
f418d06
Merge branch 'cgridDEV' of https://github.com/apcraig/cice into cgrid…
apcraig Mar 19, 2022
ec00315
Clean up whitespace, indentation in dynamics files (#84)
apcraig Mar 22, 2022
150182d
Refactor visc_replpres implementation, get rid of separate avgstr and…
apcraig Mar 23, 2022
bffe4e8
Refactor strain_rates_T, strain_rates_U (#86)
apcraig Mar 26, 2022
501c582
Update ice_data_type implementations for flexibility and transparency…
apcraig Apr 6, 2022
014852a
Add memory diagnostics (#90)
apcraig Apr 10, 2022
6ff1a71
New deformationsC_T subroutine for more consistent calculation (#89)
JFLemieux73 Apr 10, 2022
a131940
Cgrid documentation (#91)
JFLemieux73 Apr 14, 2022
9b7c5de
Update Orion port, working again (#92)
apcraig Apr 14, 2022
da68566
More machine updates, Cori, Onyx, Narwhal, Hera (#93)
apcraig Apr 18, 2022
ca3a1be
Modifications to the doc related to rEVP (#94)
JFLemieux73 Apr 19, 2022
99b6475
update documentation (#95)
apcraig Apr 19, 2022
698d03f
update documentation (#96)
apcraig Apr 19, 2022
5a150aa
update documentation (#97)
apcraig Apr 19, 2022
79bf252
Rename some sections in the documentation (#98)
JFLemieux73 Apr 28, 2022
ce10b82
Merge branch 'cgridDEV' of https://github.com/apcraig/cice into cgrid…
apcraig May 3, 2022
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
1 change: 1 addition & 0 deletions .github/workflows/test-cice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
run: |
sudo xcode-select -r
sudo xcode-select -s /Library/Developer/CommandLineTools
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
echo "xcrun --show-sdk-path: $(xcrun --show-sdk-path)"
echo "xcode-select -p: $(xcode-select -p)"
- name: system info
Expand Down
172 changes: 159 additions & 13 deletions cicecore/cicedynB/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ subroutine runtime_diags (dt)
alvdr_init, alvdf_init, alidr_init, alidf_init
use ice_flux_bgc, only: faero_atm, faero_ocn, fiso_atm, fiso_ocn
use ice_global_reductions, only: global_sum, global_sum_prod, global_maxval
use ice_grid, only: lmask_n, lmask_s, tarean, tareas
use ice_grid, only: lmask_n, lmask_s, tarean, tareas, grid_ice
use ice_state ! everything
! tcraig, this is likely to cause circular dependency because ice_prescribed_mod is high level routine
#ifdef CESMCOUPLED
Expand Down Expand Up @@ -201,6 +201,17 @@ subroutine runtime_diags (dt)
real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: &
work1, work2

real (kind=dbl_kind), parameter :: &
maxval_spval = -0.9_dbl_kind*HUGE(0.0_dbl_kind) ! spval to detect
! undefined values returned from global_maxval. if global_maxval
! is applied to a region that does not exist (for instance
! southern hemisphere in box cases), global_maxval
! returns -HUGE which we want to avoid writing. The
! return value is checked against maxval_spval before writing.

! real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: &
! uvelT, vvelT

character(len=*), parameter :: subname = '(runtime_diags)'

call icepack_query_parameters(ktherm_out=ktherm, calc_Tsfc_out=calc_Tsfc)
Expand Down Expand Up @@ -228,6 +239,8 @@ subroutine runtime_diags (dt)
! hemispheric quantities

! total ice area
arean = c0
areas = c0
arean = global_sum(aice, distrb_info, field_loc_center, tarean)
areas = global_sum(aice, distrb_info, field_loc_center, tareas)
arean = arean * m2_to_km2
Expand All @@ -244,6 +257,8 @@ subroutine runtime_diags (dt)
enddo
enddo
!$OMP END PARALLEL DO
extentn = c0
extents = c0
extentn = global_sum(work1, distrb_info, field_loc_center, &
tarean)
extents = global_sum(work1, distrb_info, field_loc_center, &
Expand All @@ -252,10 +267,14 @@ subroutine runtime_diags (dt)
extents = extents * m2_to_km2

! total ice volume
shmaxn = c0
shmaxs = c0
shmaxn = global_sum(vice, distrb_info, field_loc_center, tarean)
shmaxs = global_sum(vice, distrb_info, field_loc_center, tareas)

! total snow volume
snwmxn = c0
snwmxs = c0
snwmxn = global_sum(vsno, distrb_info, field_loc_center, tarean)
snwmxs = global_sum(vsno, distrb_info, field_loc_center, tareas)

Expand Down Expand Up @@ -293,7 +312,25 @@ subroutine runtime_diags (dt)
enddo
enddo
enddo
!$OMP END PARALLEL DO
! Eventually do energy diagnostic on T points.
! if (grid_ice == 'CD') then
! !$OMP PARALLEL DO PRIVATE(iblk,i,j)
! do iblk = 1, nblocks
! do j = 1, ny_block
! do i = 1, nx_block
! call grid_average_X2Y('E2TS',uvelE,uvelT)
! call grid_average_X2Y('N2TS',vvelN,vvelT)
! work1(i,j,iblk) = p5 &
! * (rhos*vsno(i,j,iblk) + rhoi*vice(i,j,iblk)) &
! * (uvelT(i,j,iblk)*uvelT(i,j,iblk) &
! + vvelT(i,j,iblk)*vvelT(i,j,iblk))
! enddo
! enddo
! enddo
! endif
! !$OMP END PARALLEL DO
ketotn = c0
ketots = c0
ketotn = global_sum(work1, distrb_info, field_loc_center, tarean)
ketots = global_sum(work1, distrb_info, field_loc_center, tareas)

Expand Down Expand Up @@ -370,23 +407,57 @@ subroutine runtime_diags (dt)
endif

! maximum ice volume (= mean thickness including open water)
hmaxn = c0
hmaxs = c0
hmaxn = global_maxval(vice, distrb_info, lmask_n)
hmaxs = global_maxval(vice, distrb_info, lmask_s)
if (hmaxn < maxval_spval) hmaxn = c0
if (hmaxs < maxval_spval) hmaxs = c0

! maximum ice speed
!$OMP PARALLEL DO PRIVATE(iblk,i,j)
do iblk = 1, nblocks
do j = 1, ny_block
do i = 1, nx_block
work1(i,j,iblk) = sqrt(uvel(i,j,iblk)**2 &
+ vvel(i,j,iblk)**2)
if (grid_ice == 'CD') then
!$OMP PARALLEL DO PRIVATE(iblk,i,j)
do iblk = 1, nblocks
do j = 1, ny_block
do i = 1, nx_block
work1(i,j,iblk) = max(sqrt(uvelE(i,j,iblk)**2 &
+ vvelE(i,j,iblk)**2), &
sqrt(uvelN(i,j,iblk)**2 &
+ vvelN(i,j,iblk)**2))
enddo
enddo
enddo
!$OMP END PARALLEL DO
elseif (grid_ice == 'C') then
!$OMP PARALLEL DO PRIVATE(iblk,i,j)
do iblk = 1, nblocks
do j = 1, ny_block
do i = 1, nx_block
work1(i,j,iblk) = sqrt(uvelE(i,j,iblk)**2 &
+ vvelN(i,j,iblk)**2)
enddo
enddo
enddo
enddo
!$OMP END PARALLEL DO
!$OMP END PARALLEL DO
else
!$OMP PARALLEL DO PRIVATE(iblk,i,j)
do iblk = 1, nblocks
do j = 1, ny_block
do i = 1, nx_block
work1(i,j,iblk) = sqrt(uvel(i,j,iblk)**2 &
+ vvel(i,j,iblk)**2)
enddo
enddo
enddo
!$OMP END PARALLEL DO
endif

umaxn = c0
umaxs = c0
umaxn = global_maxval(work1, distrb_info, lmask_n)
umaxs = global_maxval(work1, distrb_info, lmask_s)
if (umaxn < maxval_spval) umaxn = c0
if (umaxs < maxval_spval) umaxs = c0

! Write warning message if ice speed is too big
! (Ice speeds of ~1 m/s or more usually indicate instability)
Expand Down Expand Up @@ -427,8 +498,12 @@ subroutine runtime_diags (dt)

! maximum ice strength

pmaxn = c0
pmaxs = c0
pmaxn = global_maxval(strength, distrb_info, lmask_n)
pmaxs = global_maxval(strength, distrb_info, lmask_s)
if (pmaxn < maxval_spval) pmaxn = c0
if (pmaxs < maxval_spval) pmaxs = c0

pmaxn = pmaxn / c1000 ! convert to kN/m
pmaxs = pmaxs / c1000
Expand All @@ -437,7 +512,9 @@ subroutine runtime_diags (dt)

! total ice/snow internal energy
call total_energy (work1)


etotn = c0
etots = c0
etotn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
etots = global_sum(work1, distrb_info, &
Expand All @@ -452,6 +529,8 @@ subroutine runtime_diags (dt)

! evaporation

evpn = c0
evps = c0
evpn = global_sum_prod(evap, aice, distrb_info, &
field_loc_center, tarean)
evps = global_sum_prod(evap, aice, distrb_info, &
Expand All @@ -470,6 +549,8 @@ subroutine runtime_diags (dt)
endif

! salt flux
sfsaltn = c0
sfsalts = c0
sfsaltn = global_sum(fsalt_ai, distrb_info, &
field_loc_center, tarean)
sfsalts = global_sum(fsalt_ai, distrb_info, &
Expand All @@ -478,6 +559,8 @@ subroutine runtime_diags (dt)
sfsalts = sfsalts*dt

! fresh water flux
sfreshn = c0
sfreshs = c0
sfreshn = global_sum(fresh_ai, distrb_info, &
field_loc_center, tarean)
sfreshs = global_sum(fresh_ai, distrb_info, &
Expand All @@ -499,6 +582,8 @@ subroutine runtime_diags (dt)

! ocean heat
! Note: fswthru not included because it does not heat ice
fhocnn = c0
fhocns = c0
fhocnn = global_sum(fhocn_ai, distrb_info, &
field_loc_center, tarean)
fhocns = global_sum(fhocn_ai, distrb_info, &
Expand Down Expand Up @@ -548,6 +633,8 @@ subroutine runtime_diags (dt)

endif ! calc_Tsfc

fhatmn = c0
fhatms = c0
fhatmn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
fhatms = global_sum(work1, distrb_info, &
Expand All @@ -564,6 +651,8 @@ subroutine runtime_diags (dt)
enddo
!$OMP END PARALLEL DO

fswnetn = c0
fswnets = c0
fswnetn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
fswnets = global_sum(work1, distrb_info, &
Expand All @@ -582,6 +671,8 @@ subroutine runtime_diags (dt)
enddo
!$OMP END PARALLEL DO

fswdnn = c0
fswdns = c0
fswdnn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
fswdns = global_sum(work1, distrb_info, &
Expand All @@ -597,12 +688,17 @@ subroutine runtime_diags (dt)
enddo
enddo
!$OMP END PARALLEL DO

fhfrzn = c0
fhfrzs = c0
fhfrzn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
fhfrzs = global_sum(work1, distrb_info, &
field_loc_center, tareas)

! rain
rnn = c0
rns = c0
rnn = global_sum_prod(frain, aice_init, distrb_info, &
field_loc_center, tarean)
rns = global_sum_prod(frain, aice_init, distrb_info, &
Expand All @@ -611,6 +707,8 @@ subroutine runtime_diags (dt)
rns = rns*dt

! snow
snn = c0
sns = c0
snn = global_sum_prod(fsnow, aice_init, distrb_info, &
field_loc_center, tarean)
sns = global_sum_prod(fsnow, aice_init, distrb_info, &
Expand All @@ -623,6 +721,8 @@ subroutine runtime_diags (dt)
work1(:,:,:) = frazil(:,:,:)*rhoi/dt
if (ktherm == 2 .and. .not.update_ocn_f) &
work1(:,:,:) = (frazil(:,:,:)-frazil_diag(:,:,:))*rhoi/dt
frzn = c0
frzs = c0
frzn = global_sum(work1, distrb_info, &
field_loc_center, tarean)
frzs = global_sum(work1, distrb_info, &
Expand Down Expand Up @@ -706,6 +806,16 @@ subroutine runtime_diags (dt)

! isotopes
if (tr_iso) then
fisoan = c0
fisoas = c0
fisoon = c0
fisoos = c0
isototn = c0
isotots = c0
isomx1n = c0
isomx1s = c0
isorn = c0
isors = c0
do n = 1, n_iso
fisoan(n) = global_sum_prod(fiso_atm(:,:,n,:), aice_init, &
distrb_info, field_loc_center, tarean)
Expand Down Expand Up @@ -738,13 +848,25 @@ subroutine runtime_diags (dt)
isotots(n) = global_sum(work1, distrb_info, field_loc_center, tareas)
isomx1n(n) = global_maxval(work1, distrb_info, lmask_n)
isomx1s(n) = global_maxval(work1, distrb_info, lmask_s)
if (isomx1n(n) < maxval_spval) isomx1n(n) = c0
if (isomx1s(n) < maxval_spval) isomx1s(n) = c0
isorn(n) = (totison(n)-isototn(n)+fisoan(n)-fisoon(n))/(isototn(n)+c1)
isors(n) = (totisos(n)-isotots(n)+fisoas(n)-fisoos(n))/(isotots(n)+c1)
enddo ! n_iso
endif ! tr_iso

! aerosols
if (tr_aero) then
faeran = c0
faeras = c0
faeron = c0
faeros = c0
aerototn = c0
aerotots = c0
aeromx1n = c0
aeromx1s = c0
aerrn = c0
aerrs = c0
do n = 1, n_aero
faeran(n) = global_sum_prod(faero_atm(:,:,n,:), aice_init, &
distrb_info, field_loc_center, tarean)
Expand Down Expand Up @@ -776,6 +898,8 @@ subroutine runtime_diags (dt)
aerotots(n) = global_sum(work1, distrb_info, field_loc_center, tareas)
aeromx1n(n) = global_maxval(work1, distrb_info, lmask_n)
aeromx1s(n) = global_maxval(work1, distrb_info, lmask_s)
if (aeromx1n(n) < maxval_spval) aeromx1n(n) = c0
if (aeromx1s(n) < maxval_spval) aeromx1s(n) = c0

aerrn(n) = (totaeron(n)-aerototn(n)+faeran(n)-faeron(n)) &
/ (aerototn(n) + c1)
Expand Down Expand Up @@ -1629,10 +1753,12 @@ end subroutine debug_ice

subroutine print_state(plabel,i,j,iblk)

use ice_grid, only: grid_ice
use ice_blocks, only: block, get_block
use ice_domain, only: blocks_ice
use ice_domain_size, only: ncat, nilyr, nslyr, nfsd
use ice_state, only: aice0, aicen, vicen, vsnon, uvel, vvel, trcrn
use ice_state, only: aice0, aicen, vicen, vsnon, uvel, vvel, &
uvelE, vvelE, uvelN, vvelN, trcrn
use ice_flux, only: uatm, vatm, potT, Tair, Qa, flw, frain, fsnow, &
fsens, flat, evap, flwout, swvdr, swvdf, swidr, swidf, rhoa, &
frzmlt, sst, sss, Tf, Tref, Qref, Uref, uocn, vocn, strtltx, strtlty
Expand Down Expand Up @@ -1754,6 +1880,15 @@ subroutine print_state(plabel,i,j,iblk)

write(nu_diag,*) 'uvel(i,j)',uvel(i,j,iblk)
write(nu_diag,*) 'vvel(i,j)',vvel(i,j,iblk)
if (grid_ice == 'C') then
write(nu_diag,*) 'uvelE(i,j)',uvelE(i,j,iblk)
write(nu_diag,*) 'uvelN(i,j)',uvelN(i,j,iblk)
elseif (grid_ice == 'CD') then
write(nu_diag,*) 'uvelE(i,j)',uvelE(i,j,iblk)
write(nu_diag,*) 'vvelE(i,j)',vvelE(i,j,iblk)
write(nu_diag,*) 'uvelN(i,j)',uvelN(i,j,iblk)
write(nu_diag,*) 'vvelN(i,j)',vvelN(i,j,iblk)
endif

write(nu_diag,*) ' '
write(nu_diag,*) 'atm states and fluxes'
Expand Down Expand Up @@ -1801,10 +1936,12 @@ end subroutine print_state

subroutine print_points_state(plabel,ilabel)

use ice_grid, only: grid_ice
use ice_blocks, only: block, get_block
use ice_domain, only: blocks_ice
use ice_domain_size, only: ncat, nilyr, nslyr
use ice_state, only: aice0, aicen, vicen, vsnon, uvel, vvel, trcrn
use ice_state, only: aice0, aicen, vicen, vsnon, uvel, vvel, &
uvelE, vvelE, uvelE, vvelE, trcrn
use ice_flux, only: uatm, vatm, potT, Tair, Qa, flw, frain, fsnow, &
fsens, flat, evap, flwout, swvdr, swvdf, swidr, swidf, rhoa, &
frzmlt, sst, sss, Tf, Tref, Qref, Uref, uocn, vocn, strtltx, strtlty
Expand Down Expand Up @@ -1896,6 +2033,15 @@ subroutine print_points_state(plabel,ilabel)

write(nu_diag,*) trim(llabel),'uvel=',uvel(i,j,iblk)
write(nu_diag,*) trim(llabel),'vvel=',vvel(i,j,iblk)
if (grid_ice == 'C') then
write(nu_diag,*) trim(llabel),'uvelE=',uvelE(i,j,iblk)
write(nu_diag,*) trim(llabel),'vvelN=',vvelN(i,j,iblk)
elseif (grid_ice == 'CD') then
write(nu_diag,*) trim(llabel),'uvelE=',uvelE(i,j,iblk)
write(nu_diag,*) trim(llabel),'vvelE=',vvelE(i,j,iblk)
write(nu_diag,*) trim(llabel),'uvelN=',uvelN(i,j,iblk)
write(nu_diag,*) trim(llabel),'vvelN=',vvelN(i,j,iblk)
endif

write(nu_diag,*) ' '
write(nu_diag,*) 'atm states and fluxes'
Expand Down
Loading