From 4e2d90b5bf5d8f78d751f2e5f8e95fdf26f5dea8 Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 25 Aug 2022 17:27:57 -0600 Subject: [PATCH 1/2] Update ssp output --- columnphysics/icepack_shortwave.F90 | 12 +++++-- configuration/driver/icedrv_forcing.F90 | 46 ++++++++++++++++--------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/columnphysics/icepack_shortwave.F90 b/columnphysics/icepack_shortwave.F90 index 4649d205a..dc3dc3029 100644 --- a/columnphysics/icepack_shortwave.F90 +++ b/columnphysics/icepack_shortwave.F90 @@ -260,11 +260,17 @@ subroutine icepack_init_radiation return endif - write(warnstr,*) subname, ' nmbrad_snicar = ',nmbrad_snicar + write(warnstr,'(2a,i8)') subname, ' nmbrad_snicar = ',nmbrad_snicar call icepack_warnings_add(warnstr) - write(warnstr,*) subname, ' nspint = ',nspint_5bd + write(warnstr,'(2a,i8)') subname, ' nspint = ',nspint_5bd call icepack_warnings_add(warnstr) - write(warnstr,*) subname, ' ssp_snwextdr(1,1) = ',ssp_snwextdr(1,1) + write(warnstr,'(2a,i5,a,i5,a,g14.7)') subname, ' ssp_snwextdr(',1, ',',1, ') = ',ssp_snwextdr(1,1) + call icepack_warnings_add(warnstr) + write(warnstr,'(2a,i5,a,i5,a,g14.7)') subname, ' ssp_snwextdr(',nspint_5bd,',',1, ') = ',ssp_snwextdr(nspint_5bd,1) + call icepack_warnings_add(warnstr) + write(warnstr,'(2a,i5,a,i5,a,g14.7)') subname, ' ssp_snwextdr(',1, ',',nmbrad_snicar,') = ',ssp_snwextdr(1,nmbrad_snicar) + call icepack_warnings_add(warnstr) + write(warnstr,'(2a,i5,a,i5,a,g14.7)') subname, ' ssp_snwextdr(',nspint_5bd,',',nmbrad_snicar,') = ',ssp_snwextdr(nspint_5bd,nmbrad_snicar) call icepack_warnings_add(warnstr) endif diff --git a/configuration/driver/icedrv_forcing.F90 b/configuration/driver/icedrv_forcing.F90 index 830949f7d..afcd2745c 100644 --- a/configuration/driver/icedrv_forcing.F90 +++ b/configuration/driver/icedrv_forcing.F90 @@ -1291,23 +1291,37 @@ subroutine init_snicarssptable write(nu_diag,*) subname,' ' write(nu_diag,*) subname,' Successfully initialized SNICAR SSP tables:' - write(nu_diag,*) subname,' ssp_filename = ',trim(ssp_filename) - write(nu_diag,*) subname,' SSP N spectral int = ',nspint - write(nu_diag,*) subname,' SSP N snow grain rad = ',nsrad + write(nu_diag,*) subname,' ssp_filename = ',trim(ssp_filename) + write(nu_diag,*) subname,' SSP N spectral int, m1 = ',nspint + write(nu_diag,*) subname,' SSP N snow grain rad, m2 = ',nsrad write(nu_diag,*) subname,' Data at first index ' - write(nu_diag,*) subname,' ssp_snwextdr(1,1) = ',ssp_snwextdr(1,1) - write(nu_diag,*) subname,' ssp_snwextdf(1,1) = ',ssp_snwextdf(1,1) - write(nu_diag,*) subname,' ssp_snwalbdr(1,1) = ',ssp_snwalbdr(1,1) - write(nu_diag,*) subname,' ssp_snwalbdf(1,1) = ',ssp_snwalbdf(1,1) - write(nu_diag,*) subname,' ssp_sasymmdr(1,1) = ',ssp_sasymmdr(1,1) - write(nu_diag,*) subname,' ssp_sasymmdf(1,1) = ',ssp_sasymmdf(1,1) - write(nu_diag,*) subname,' Data at final index ' - write(nu_diag,*) subname,' ssp_snwextdr(max,max) = ',ssp_snwextdr(nspint,nsrad) - write(nu_diag,*) subname,' ssp_snwextdf(max,max) = ',ssp_snwextdf(nspint,nsrad) - write(nu_diag,*) subname,' ssp_snwalbdr(max,max) = ',ssp_snwalbdr(nspint,nsrad) - write(nu_diag,*) subname,' ssp_snwalbdf(max,max) = ',ssp_snwalbdf(nspint,nsrad) - write(nu_diag,*) subname,' ssp_sasymmdr(max,max) = ',ssp_sasymmdr(nspint,nsrad) - write(nu_diag,*) subname,' ssp_sasymmdf(max,max) = ',ssp_sasymmdf(nspint,nsrad) + write(nu_diag,*) subname,' ssp_snwextdr(1,1) = ',ssp_snwextdr(1,1) + write(nu_diag,*) subname,' ssp_snwextdf(1,1) = ',ssp_snwextdf(1,1) + write(nu_diag,*) subname,' ssp_snwalbdr(1,1) = ',ssp_snwalbdr(1,1) + write(nu_diag,*) subname,' ssp_snwalbdf(1,1) = ',ssp_snwalbdf(1,1) + write(nu_diag,*) subname,' ssp_sasymmdr(1,1) = ',ssp_sasymmdr(1,1) + write(nu_diag,*) subname,' ssp_sasymmdf(1,1) = ',ssp_sasymmdf(1,1) + write(nu_diag,*) subname,' Data at ',nspint,',1 index ' + write(nu_diag,*) subname,' ssp_snwextdr(m1,1) = ',ssp_snwextdr(nspint,1) + write(nu_diag,*) subname,' ssp_snwextdf(m1,1) = ',ssp_snwextdf(nspint,1) + write(nu_diag,*) subname,' ssp_snwalbdr(m1,1) = ',ssp_snwalbdr(nspint,1) + write(nu_diag,*) subname,' ssp_snwalbdf(m1,1) = ',ssp_snwalbdf(nspint,1) + write(nu_diag,*) subname,' ssp_sasymmdr(m1,1) = ',ssp_sasymmdr(nspint,1) + write(nu_diag,*) subname,' ssp_sasymmdf(m1,1) = ',ssp_sasymmdf(nspint,1) + write(nu_diag,*) subname,' Data at 1,',nsrad,' index ' + write(nu_diag,*) subname,' ssp_snwextdr(1,m2) = ',ssp_snwextdr(1,nsrad) + write(nu_diag,*) subname,' ssp_snwextdf(1,m2) = ',ssp_snwextdf(1,nsrad) + write(nu_diag,*) subname,' ssp_snwalbdr(1,m2) = ',ssp_snwalbdr(1,nsrad) + write(nu_diag,*) subname,' ssp_snwalbdf(1,m2) = ',ssp_snwalbdf(1,nsrad) + write(nu_diag,*) subname,' ssp_sasymmdr(1,m2) = ',ssp_sasymmdr(1,nsrad) + write(nu_diag,*) subname,' ssp_sasymmdf(1,m2) = ',ssp_sasymmdf(1,nsrad) + write(nu_diag,*) subname,' Data at ',nspint,nsrad,' index ' + write(nu_diag,*) subname,' ssp_snwextdr(m1,m2) = ',ssp_snwextdr(nspint,nsrad) + write(nu_diag,*) subname,' ssp_snwextdf(m1,m2) = ',ssp_snwextdf(nspint,nsrad) + write(nu_diag,*) subname,' ssp_snwalbdr(m1,m2) = ',ssp_snwalbdr(nspint,nsrad) + write(nu_diag,*) subname,' ssp_snwalbdf(m1,m2) = ',ssp_snwalbdf(nspint,nsrad) + write(nu_diag,*) subname,' ssp_sasymmdr(m1,m2) = ',ssp_sasymmdr(nspint,nsrad) + write(nu_diag,*) subname,' ssp_sasymmdf(m1,m2) = ',ssp_sasymmdf(nspint,nsrad) call icepack_init_parameters( & ssp_snwextdr_in = ssp_snwextdr, ssp_snwextdf_in = ssp_snwextdf, & From e569c4cafc34d06cdf92c4db2d888120a081082c Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 25 Aug 2022 18:24:12 -0600 Subject: [PATCH 2/2] Reorder SNICAR SSP test data arrays to be consistent with source code --- columnphysics/icepack_shortwave.F90 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/columnphysics/icepack_shortwave.F90 b/columnphysics/icepack_shortwave.F90 index dc3dc3029..4bf83be32 100644 --- a/columnphysics/icepack_shortwave.F90 +++ b/columnphysics/icepack_shortwave.F90 @@ -194,13 +194,16 @@ subroutine icepack_init_radiation allocate(ssp_sasymmdr(nspint_5bd,nmbrad_snicar)) ! snow asymmetry factor, direct allocate(ssp_sasymmdf(nspint_5bd,nmbrad_snicar)) ! snow asymmetry factor, diffuse + ! tcraig, these data statements are not consistent with the array index order + ! reshape from nmbrad,nspint to nspint,nmbrad with order = 2,1 + ssp_snwextdr = reshape((/ & 46.27374983, 24.70286257, 6.54918455, 2.6035624, 1.196168, & 46.56827715, 24.81790668, 6.56181227, 2.60604155, 1.19682614, & 46.76114033, 24.90468677, 6.56950323, 2.60780948, 1.19737512, & 46.9753992, 24.9495155, 6.57687695, 2.60937383, 1.19774008, & 47.48598349, 25.14100194, 6.59708024, 2.61372576, 1.19897351 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) ssp_snwextdf = reshape((/ & 46.26936158, 24.70165487, 6.54903637, 2.60353051, 1.19615825, & @@ -208,7 +211,7 @@ subroutine icepack_init_radiation 46.75501968, 24.90175807, 6.5693214, 2.60775795, 1.19736237, & 46.95368476, 24.94497414, 6.57612007, 2.60924059, 1.19770981, & 47.29620774, 25.0713585, 6.5891698, 2.61198929, 1.19850197 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) ssp_snwalbdr = reshape((/ & 0.99999581, 0.99999231, 0.99997215, 0.99993093, 0.99985157, & @@ -216,7 +219,7 @@ subroutine icepack_init_radiation 0.99909682, 0.99835523, 0.99418008, 0.98592085, 0.97062632, & 0.99308867, 0.98972448, 0.97261528, 0.93947995, 0.88207117, & 0.93322249, 0.89645776, 0.75765643, 0.6272883, 0.55435033 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) ssp_snwalbdf = reshape((/ & 0.99999586, 0.9999924, 0.99997249, 0.99993178, 0.9998534, & @@ -224,7 +227,7 @@ subroutine icepack_init_radiation 0.99910997, 0.99837683, 0.99426171, 0.98610431, 0.97097643, & 0.99476731, 0.9916114, 0.97441209, 0.94127464, 0.88440735, & 0.9419837, 0.90613207, 0.77042376, 0.63887161, 0.5566098 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) ssp_sasymmdr = reshape((/ & 0.88503036, 0.88778473, 0.89049023, 0.89112501, 0.89136157, & @@ -232,7 +235,7 @@ subroutine icepack_init_radiation 0.88440201, 0.88928256, 0.89503166, 0.89762648, 0.90045378, & 0.88590371, 0.89350221, 0.90525156, 0.91314567, 0.92157748, & 0.9033537, 0.91778261, 0.94615574, 0.96323447, 0.97167644 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) ssp_sasymmdf = reshape((/ & 0.88500571, 0.88773868, 0.89042496, 0.8910553, 0.89128949, & @@ -240,7 +243,7 @@ subroutine icepack_init_radiation 0.88441433, 0.88929133, 0.89500611, 0.89756091, 0.90035504, & 0.88495554, 0.89201556, 0.90204619, 0.90914885, 0.91769988, & 0.89620237, 0.90998944, 0.94126152, 0.96209938, 0.9726631 /), & - (/nspint_5bd,nmbrad_snicar/)) + (/nmbrad_snicar,nspint_5bd/), order=(/ 2, 1 /)) else call icepack_warnings_setabort(.true.,__FILE__,__LINE__)