From efbfd448180782ecf2e7930deb144dd64e5bd903 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 13 Mar 2024 15:18:15 -0600 Subject: [PATCH 01/12] set CCSM_BGC and CCSM_CO2_PPMV in MOM6+MARBL cases Copied POP2%ECO values to use as MOM6%MARBL values (want them for abio as well as base bio runs) --- cime_config/config_component_cesm.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cime_config/config_component_cesm.xml b/cime_config/config_component_cesm.xml index dbf3b11e3..7a7db4521 100644 --- a/cime_config/config_component_cesm.xml +++ b/cime_config/config_component_cesm.xml @@ -109,6 +109,8 @@ none CO2A CO2A + CO2A + CO2A CO2A CO2A CO2A @@ -496,6 +498,7 @@ 284.7 367.0 + 284.317 284.317 284.7 From 95137f44e8f37ee7a54091f511f1d8ef3a3b5252 Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Mon, 24 Jun 2024 10:32:03 -0400 Subject: [PATCH 02/12] fix use_float=.true. for aux history files --- mediator/med_io_mod.F90 | 31 +++++++++++++++++++++++++++-- mediator/med_phases_history_mod.F90 | 18 +++++++++++------ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/mediator/med_io_mod.F90 b/mediator/med_io_mod.F90 index f4abadaf6..5ff625b9f 100644 --- a/mediator/med_io_mod.F90 +++ b/mediator/med_io_mod.F90 @@ -1020,9 +1020,17 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & write(tmpstr,*) subname,' dof = ',ns,size(dof),dof(1),dof(ns) !,minval(dof),maxval(dof) call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) if (tiles) then - call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny,ntile/), dof, iodesc) + if (luse_float) then + call pio_initdecomp(io_subsystem, pio_real, (/lnx,lny,lntile/), dof, iodesc) + else + call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny,lntile/), dof, iodesc) + end if else + if (luse_float) then + call pio_initdecomp(io_subsystem, pio_real, (/lnx,lny/), dof, iodesc) + else call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny/), dof, iodesc) + end if !call pio_writedof(lpre, (/lnx,lny/), int(dof,kind=PIO_OFFSET_KIND), mpicom) end if deallocate(dof) @@ -1056,10 +1064,18 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & rcode = pio_inq_varid(io_file, trim(name1), varid) call pio_setframe(io_file,varid,frame) + if (luse_float) then if (gridToFieldMap(1) == 1) then + call pio_write_darray(io_file, varid, iodesc, real(fldptr2(:,n),r4), rcode, fillval=real(lfillvalue,r4)) + else if (gridToFieldMap(1) == 2) then + call pio_write_darray(io_file, varid, iodesc, real(fldptr2(n,:),r4), rcode, fillval=real(lfillvalue,r4)) + end if + else + if (gridToFieldMap(1) == 1) then call pio_write_darray(io_file, varid, iodesc, fldptr2(:,n), rcode, fillval=lfillvalue) else if (gridToFieldMap(1) == 2) then call pio_write_darray(io_file, varid, iodesc, fldptr2(n,:), rcode, fillval=lfillvalue) + end if end if end do else if (rank == 1 .or. rank == 0) then @@ -1068,7 +1084,11 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & call pio_setframe(io_file,varid,frame) ! fix for writing data on exchange grid, which has no data in some PETs if (rank == 0) nullify(fldptr1) + if (luse_float) then + call pio_write_darray(io_file, varid, iodesc, real(fldptr1,r4), rcode, fillval=real(lfillvalue,r4)) + else call pio_write_darray(io_file, varid, iodesc, fldptr1, rcode, fillval=lfillvalue) + end if end if ! end if rank is 2 or 1 or 0 end if ! end if not "hgt" @@ -1077,12 +1097,19 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & ! Fill coordinate variables - why is this being done each time? rcode = pio_inq_varid(io_file, trim(coordvarnames(1)), varid) call pio_setframe(io_file,varid,frame) + if (luse_float) then + call pio_write_darray(io_file, varid, iodesc, real(ownedElemCoords_x,r4), rcode, fillval=real(lfillvalue,r4)) + else call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_x, rcode, fillval=lfillvalue) + end if rcode = pio_inq_varid(io_file, trim(coordvarnames(2)), varid) call pio_setframe(io_file,varid,frame) + if (luse_float) then + call pio_write_darray(io_file, varid, iodesc, real(ownedElemCoords_y,r4), rcode, fillval=real(lfillvalue,r4)) + else call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_y, rcode, fillval=lfillvalue) - + end if call pio_syncfile(io_file) call pio_freedecomp(io_file, iodesc) endif diff --git a/mediator/med_phases_history_mod.F90 b/mediator/med_phases_history_mod.F90 index 0a6a7775d..f485ae134 100644 --- a/mediator/med_phases_history_mod.F90 +++ b/mediator/med_phases_history_mod.F90 @@ -357,11 +357,13 @@ subroutine med_phases_history_write(gcomp, rc) end if if (ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_ocnalb_a,rc=rc)) then call med_io_write(io_file, is_local%wrap%FBMed_ocnalb_a, whead(m), wdata(m), & - is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_alb_atm', rc=rc) + is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_alb_atm', & + ntile=is_local%wrap%ntile(compatm), rc=rc) end if if (ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_aoflux_a,rc=rc)) then call med_io_write(io_file, is_local%wrap%FBMed_aoflux_a, whead(m), wdata(m), & - is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_aoflux_atm', rc=rc) + is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_aoflux_atm', & + ntile=is_local%wrap%ntile(compatm), rc=rc) end if end do ! end of loop over whead/wdata m index phases @@ -495,7 +497,8 @@ subroutine med_phases_history_write_med(gcomp, rc) end if if (ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_aoflux_a,rc=rc)) then call med_io_write(instfiles(compmed)%io_file, is_local%wrap%FBMed_aoflux_a, whead(m), wdata(m), & - is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_aoflux_atm', rc=rc) + is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_aoflux_atm', & + ntile=is_local%wrap%ntile(compatm), rc=rc) end if ! If appropriate - write ocn albedos computed in mediator @@ -505,7 +508,8 @@ subroutine med_phases_history_write_med(gcomp, rc) end if if (ESMF_FieldBundleIsCreated(is_local%wrap%FBMed_ocnalb_a,rc=rc)) then call med_io_write(instfiles(compmed)%io_file, is_local%wrap%FBMed_ocnalb_a, whead(m), wdata(m), & - is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_alb_atm', rc=rc) + is_local%wrap%nx(compatm), is_local%wrap%ny(compatm), nt=1, pre='Med_alb_atm', & + ntile=is_local%wrap%ntile(compatm), rc=rc) end if end do ! end of loop over m @@ -1313,13 +1317,15 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc) ! Write data variables for time nt if (auxcomp%files(nf)%doavg) then call med_io_write(auxcomp%files(nf)%io_file, auxcomp%files(nf)%FBaccum, whead(2), wdata(2), nx, ny, & - nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, rc=rc) + nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, & + use_float=.true.,rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call med_methods_FB_reset(auxcomp%files(nf)%FBaccum, value=czero, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return else call med_io_write(auxcomp%files(nf)%io_file, is_local%wrap%FBimp(compid,compid), whead(2), wdata(2), nx, ny, & - nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, rc=rc) + nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, & + use_float=.true.,rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return end if From dc501e96d7123f604f84cbe6e6c61dc8e8cfb13c Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Mon, 24 Jun 2024 10:38:06 -0400 Subject: [PATCH 03/12] fix indenting --- mediator/med_io_mod.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mediator/med_io_mod.F90 b/mediator/med_io_mod.F90 index 5ff625b9f..e9648f905 100644 --- a/mediator/med_io_mod.F90 +++ b/mediator/med_io_mod.F90 @@ -1029,9 +1029,9 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & if (luse_float) then call pio_initdecomp(io_subsystem, pio_real, (/lnx,lny/), dof, iodesc) else - call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny/), dof, iodesc) + call pio_initdecomp(io_subsystem, pio_double, (/lnx,lny/), dof, iodesc) end if - !call pio_writedof(lpre, (/lnx,lny/), int(dof,kind=PIO_OFFSET_KIND), mpicom) + !call pio_writedof(lpre, (/lnx,lny/), int(dof,kind=PIO_OFFSET_KIND), mpicom) end if deallocate(dof) @@ -1065,16 +1065,16 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & call pio_setframe(io_file,varid,frame) if (luse_float) then - if (gridToFieldMap(1) == 1) then + if (gridToFieldMap(1) == 1) then call pio_write_darray(io_file, varid, iodesc, real(fldptr2(:,n),r4), rcode, fillval=real(lfillvalue,r4)) else if (gridToFieldMap(1) == 2) then call pio_write_darray(io_file, varid, iodesc, real(fldptr2(n,:),r4), rcode, fillval=real(lfillvalue,r4)) end if else if (gridToFieldMap(1) == 1) then - call pio_write_darray(io_file, varid, iodesc, fldptr2(:,n), rcode, fillval=lfillvalue) - else if (gridToFieldMap(1) == 2) then - call pio_write_darray(io_file, varid, iodesc, fldptr2(n,:), rcode, fillval=lfillvalue) + call pio_write_darray(io_file, varid, iodesc, fldptr2(:,n), rcode, fillval=lfillvalue) + else if (gridToFieldMap(1) == 2) then + call pio_write_darray(io_file, varid, iodesc, fldptr2(n,:), rcode, fillval=lfillvalue) end if end if end do @@ -1087,7 +1087,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & if (luse_float) then call pio_write_darray(io_file, varid, iodesc, real(fldptr1,r4), rcode, fillval=real(lfillvalue,r4)) else - call pio_write_darray(io_file, varid, iodesc, fldptr1, rcode, fillval=lfillvalue) + call pio_write_darray(io_file, varid, iodesc, fldptr1, rcode, fillval=lfillvalue) end if end if ! end if rank is 2 or 1 or 0 @@ -1100,7 +1100,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & if (luse_float) then call pio_write_darray(io_file, varid, iodesc, real(ownedElemCoords_x,r4), rcode, fillval=real(lfillvalue,r4)) else - call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_x, rcode, fillval=lfillvalue) + call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_x, rcode, fillval=lfillvalue) end if rcode = pio_inq_varid(io_file, trim(coordvarnames(2)), varid) @@ -1108,7 +1108,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & if (luse_float) then call pio_write_darray(io_file, varid, iodesc, real(ownedElemCoords_y,r4), rcode, fillval=real(lfillvalue,r4)) else - call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_y, rcode, fillval=lfillvalue) + call pio_write_darray(io_file, varid, iodesc, ownedElemCoords_y, rcode, fillval=lfillvalue) end if call pio_syncfile(io_file) call pio_freedecomp(io_file, iodesc) From 2bb653da9ceddef07331b92b7af381bafed2e7b2 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Thu, 27 Jun 2024 14:13:05 -0600 Subject: [PATCH 04/12] aux history (float) should not use ntiles --- mediator/med_io_mod.F90 | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mediator/med_io_mod.F90 b/mediator/med_io_mod.F90 index e9648f905..30768a648 100644 --- a/mediator/med_io_mod.F90 +++ b/mediator/med_io_mod.F90 @@ -870,15 +870,21 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & ng = maxval(maxIndexPTile) if (tiles) then - lnx = nx - lny = ny - lntile = ng/(lnx*lny) - write(tmpstr,*) subname, 'ng,lnx,lny,lntile = ',ng,lnx,lny,lntile - call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) - if (lntile /= ntile) then - call ESMF_LogWrite(trim(subname)//' ERROR: grid2d size and ntile are not consistent ', ESMF_LOGMSG_INFO) - call ESMF_Finalize(endflag=ESMF_END_ABORT) - endif + if (luse_float) then + lnx = ntile*ny*nx + lny = 1 + lntile = 1 + else + lnx = nx + lny = ny + lntile = ng/(lnx*lny) + write(tmpstr,*) subname, 'ng,lnx,lny,lntile = ',ng,lnx,lny,lntile + call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) + if (lntile /= ntile) then + call ESMF_LogWrite(trim(subname)//' ERROR: grid2d size and ntile are not consistent ', ESMF_LOGMSG_INFO) + call ESMF_Finalize(endflag=ESMF_END_ABORT) + endif + end if else lnx = ng lny = 1 @@ -902,7 +908,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & if (tiles) then rcode = pio_def_dim(io_file, trim(lpre)//'_nx', lnx, dimid3(1)) rcode = pio_def_dim(io_file, trim(lpre)//'_ny', lny, dimid3(2)) - rcode = pio_def_dim(io_file, trim(lpre)//'_ntile', ntile, dimid3(3)) + rcode = pio_def_dim(io_file, trim(lpre)//'_ntile', lntile, dimid3(3)) if (present(nt)) then dimid4(1:3) = dimid3 rcode = pio_inq_dimid(io_file, 'time', dimid4(4)) From 8a30f5083e4cec3747b328497e766e477badcd28 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Thu, 25 Jul 2024 06:41:22 -0600 Subject: [PATCH 05/12] fixes from testing for ATM auxhist output --- mediator/med_io_mod.F90 | 40 ++++++++++++++--------------- mediator/med_phases_history_mod.F90 | 8 +++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mediator/med_io_mod.F90 b/mediator/med_io_mod.F90 index 9a1185ef7..1b89f4634 100644 --- a/mediator/med_io_mod.F90 +++ b/mediator/med_io_mod.F90 @@ -870,30 +870,28 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, & ng = maxval(maxIndexPTile) if (tiles) then - if (luse_float) then - lnx = ntile*ny*nx - lny = 1 - lntile = 1 - else - lnx = nx - lny = ny - lntile = ng/(lnx*lny) - write(tmpstr,*) subname, 'ng,lnx,lny,lntile = ',ng,lnx,lny,lntile + lnx = ng + lny = 1 + lntile = 1 + if (nx > 0) lnx = nx + if (ny > 0) lny = ny + if (ntile > 0) lntile = ntile + write(tmpstr,*) subname, 'ng,lnx,lny,lntile = ',ng,lnx,lny,lntile + call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) + if (lnx*lny*lntile /= ng) then + write(tmpstr,*) subname,' ERROR: grid size not consistent ',ng,lnx,lny,lntile call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) - if (lntile /= ntile) then - call ESMF_LogWrite(trim(subname)//' ERROR: grid2d size and ntile are not consistent ', ESMF_LOGMSG_INFO) - call ESMF_Finalize(endflag=ESMF_END_ABORT) - endif + call ESMF_Finalize(endflag=ESMF_END_ABORT) end if else - lnx = ng - lny = 1 - if (nx > 0) lnx = nx - if (ny > 0) lny = ny - if (lnx*lny /= ng) then - write(tmpstr,*) subname,' WARNING: grid2d size not consistent ',ng,lnx,lny - call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) - endif + lnx = ng + lny = 1 + if (nx > 0) lnx = nx + if (ny > 0) lny = ny + if (lnx*lny /= ng) then + write(tmpstr,*) subname,' WARNING: grid2d size not consistent ',ng,lnx,lny + call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO) + endif end if deallocate(minIndexPTile, maxIndexPTile) diff --git a/mediator/med_phases_history_mod.F90 b/mediator/med_phases_history_mod.F90 index f485ae134..c895d6c42 100644 --- a/mediator/med_phases_history_mod.F90 +++ b/mediator/med_phases_history_mod.F90 @@ -1062,6 +1062,7 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc) logical :: enable_auxfile character(CL) :: time_units ! units of time variable integer :: nx,ny ! global grid size + integer :: ntile ! number of tiles for tiled domain eg CSG logical :: write_now ! if true, write time sample to file real(r8) :: time_val ! time coordinate output real(r8) :: time_bnds(2) ! time bounds output @@ -1268,6 +1269,7 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc) ! Set shorthand variables nx = is_local%wrap%nx(compid) ny = is_local%wrap%ny(compid) + ntile = is_local%wrap%ntile(compid) ! Increment number of time samples on file auxcomp%files(nf)%nt = auxcomp%files(nf)%nt + 1 @@ -1303,7 +1305,7 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc) call med_io_write(auxcomp%files(nf)%io_file, is_local%wrap%FBimp(compid,compid), & whead(1), wdata(1), nx, ny, nt=auxcomp%files(nf)%nt, & pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, & - use_float=.true., rc=rc) + use_float=.true., ntile=ntile, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! end definition phase @@ -1318,14 +1320,14 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc) if (auxcomp%files(nf)%doavg) then call med_io_write(auxcomp%files(nf)%io_file, auxcomp%files(nf)%FBaccum, whead(2), wdata(2), nx, ny, & nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, & - use_float=.true.,rc=rc) + use_float=.true., ntile=ntile, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call med_methods_FB_reset(auxcomp%files(nf)%FBaccum, value=czero, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return else call med_io_write(auxcomp%files(nf)%io_file, is_local%wrap%FBimp(compid,compid), whead(2), wdata(2), nx, ny, & nt=auxcomp%files(nf)%nt, pre=trim(compname(compid))//'Imp', flds=auxcomp%files(nf)%flds, & - use_float=.true.,rc=rc) + use_float=.true., ntile=ntile, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return end if From 882d4850238b2c9b1ce81602fc68f9744a29df9d Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Fri, 26 Jul 2024 08:26:01 -0400 Subject: [PATCH 06/12] fix garbled print statement for scalars * don't print messages if nstate is not created --- mediator/med.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mediator/med.F90 b/mediator/med.F90 index 4e1f916f3..3133c7f88 100644 --- a/mediator/med.F90 +++ b/mediator/med.F90 @@ -2154,14 +2154,13 @@ subroutine DataInitialize(gcomp, rc) end if is_local%wrap%nx(n1) = nint(real_nx) is_local%wrap%ny(n1) = nint(real_ny) - endif - if (is_local%wrap%comp_present(n1)) then + write(msgString,'(3i8)') is_local%wrap%nx(n1), is_local%wrap%ny(n1), is_local%wrap%ntile(n1) + call ESMF_LogWrite(trim(subname)//":"//trim(compname(n1))//":"//trim(msgString), ESMF_LOGMSG_INFO) if (maintask) then write(logunit,'(a)') 'global nx,ny,ntile sizes for '//trim(compname(n1))//":"//trim(msgString) end if - call ESMF_LogWrite(trim(subname)//":"//trim(compname(n1))//":"//trim(msgString), ESMF_LOGMSG_INFO) - endif + end if end do if (maintask) write(logunit,*) From e6ad65267e79aff0c3bc5af5c399df18dfe79609 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Sat, 27 Jul 2024 02:16:22 -0600 Subject: [PATCH 07/12] Compute and export heat content associated with glc runoffs --- mediator/esmFldsExchange_cesm_mod.F90 | 3 ++ mediator/fd_cesm.yaml | 10 ++++++ mediator/med_diag_mod.F90 | 22 +++++++++----- mediator/med_phases_prep_atm_mod.F90 | 3 +- mediator/med_phases_prep_ocn_mod.F90 | 44 +++++++++++++++++++-------- 5 files changed, 61 insertions(+), 21 deletions(-) diff --git a/mediator/esmFldsExchange_cesm_mod.F90 b/mediator/esmFldsExchange_cesm_mod.F90 index 7055fdf7e..eed2b2189 100644 --- a/mediator/esmFldsExchange_cesm_mod.F90 +++ b/mediator/esmFldsExchange_cesm_mod.F90 @@ -2202,6 +2202,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) ! --------------------------------------------------------------------- ! to ocn: enthalpy from atm rain, snow, evaporation ! to ocn: enthalpy from liquid and ice river runoff + ! to ocn: enthalpy from liquid and ice glacier runoff ! to ocn: enthalpy from ice melt ! --------------------------------------------------------------------- ! Note - do not need to add addmap or addmrg for the following since they @@ -2213,6 +2214,8 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) call addfld_to(compocn, 'Foxx_hcond') call addfld_to(compocn, 'Foxx_hrofl') call addfld_to(compocn, 'Foxx_hrofi') + call addfld_to(compocn, 'Foxx_hrofl_glc') + call addfld_to(compocn, 'Foxx_hrofi_glc') end if ! --------------------------------------------------------------------- diff --git a/mediator/fd_cesm.yaml b/mediator/fd_cesm.yaml index c6d57857c..e41c61dff 100644 --- a/mediator/fd_cesm.yaml +++ b/mediator/fd_cesm.yaml @@ -1023,6 +1023,16 @@ canonical_units: W m-2 description: med export to ocn heat content of ice runoff # + - standard_name: Foxx_hrofl_glc + alias: heat_content_rofl_glc + canonical_units: W m-2 + description: med export to ocn heat content of liquid glc runoff + # + - standard_name: Foxx_hrofi_glc + alias: heat_content_rofi_glc + canonical_units: W m-2 + description: med export to ocn heat content of ice glc runoff + # - standard_name: Foxx_evap alias: mean_evap_rate canonical_units: kg m-2 s-1 diff --git a/mediator/med_diag_mod.F90 b/mediator/med_diag_mod.F90 index 69ff44f2e..8bad9d5c8 100644 --- a/mediator/med_diag_mod.F90 +++ b/mediator/med_diag_mod.F90 @@ -150,6 +150,8 @@ module med_diag_mod integer :: f_heat_cond = unset_index ! heat : heat content of evaporation integer :: f_heat_rofl = unset_index ! heat : heat content of liquid runoff integer :: f_heat_rofi = unset_index ! heat : heat content of ice runoff + integer :: f_heat_rofl_glc = unset_index ! heat : heat content of liquid glc runoff + integer :: f_heat_rofi_glc = unset_index ! heat : heat content of ice glc runoff integer :: f_watr_frz = unset_index ! water: freezing integer :: f_watr_melt = unset_index ! water: melting @@ -330,14 +332,16 @@ subroutine med_diag_init(gcomp, rc) f_heat_beg = f_heat_frz ! field first index for heat f_heat_end = f_heat_sen ! field last index for heat else if (trim(budget_table_version) == 'v1') then - call add_to_budget_diag(budget_diags%fields, f_heat_rain ,'hrain' ) ! field heat : enthalpy of rain - call add_to_budget_diag(budget_diags%fields, f_heat_snow ,'hsnow' ) ! field heat : enthalpy of snow - call add_to_budget_diag(budget_diags%fields, f_heat_evap ,'hevap' ) ! field heat : enthalpy of evaporation - call add_to_budget_diag(budget_diags%fields, f_heat_cond ,'hcond' ) ! field heat : enthalpy of evaporation - call add_to_budget_diag(budget_diags%fields, f_heat_rofl ,'hrofl' ) ! field heat : enthalpy of liquid runoff - call add_to_budget_diag(budget_diags%fields, f_heat_rofi ,'hrofi' ) ! field heat : enthalpy of ice runoff + call add_to_budget_diag(budget_diags%fields, f_heat_rain ,'hrain' ) ! field heat : enthalpy of rain + call add_to_budget_diag(budget_diags%fields, f_heat_snow ,'hsnow' ) ! field heat : enthalpy of snow + call add_to_budget_diag(budget_diags%fields, f_heat_evap ,'hevap' ) ! field heat : enthalpy of evaporation + call add_to_budget_diag(budget_diags%fields, f_heat_cond ,'hcond' ) ! field heat : enthalpy of evaporation + call add_to_budget_diag(budget_diags%fields, f_heat_rofl ,'hrofl' ) ! field heat : enthalpy of liquid runoff + call add_to_budget_diag(budget_diags%fields, f_heat_rofi ,'hrofi' ) ! field heat : enthalpy of ice runoff + call add_to_budget_diag(budget_diags%fields, f_heat_rofl_glc,'hrofl_glc' ) ! field heat : enthalpy of liquid glc runoff + call add_to_budget_diag(budget_diags%fields, f_heat_rofi_glc,'hrofi_glc' ) ! field heat : enthalpy of ice glc runoff f_heat_beg = f_heat_frz ! field first index for heat - f_heat_end = f_heat_rofi ! field last index for heat + f_heat_end = f_heat_rofi_glc ! field last index for heat end if ! ----------------------------------------- @@ -1601,6 +1605,10 @@ subroutine med_phases_diag_ocn( gcomp, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call diag_ocn(is_local%wrap%FBExp(compocn), 'Foxx_hrofi', f_heat_rofi , ic, areas, sfrac, budget_local, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return + call diag_ocn(is_local%wrap%FBExp(compocn), 'Foxx_hrofl_glc', f_heat_rofl_glc, ic, areas, sfrac, budget_local, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call diag_ocn(is_local%wrap%FBExp(compocn), 'Foxx_hrofi_glc', f_heat_rofi_glc , ic, areas, sfrac, budget_local, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return budget_local(f_heat_latf,ic,ip) = -budget_local(f_watr_snow,ic,ip)*shr_const_latice budget_local(f_heat_ioff,ic,ip) = -budget_local(f_watr_ioff,ic,ip)*shr_const_latice diff --git a/mediator/med_phases_prep_atm_mod.F90 b/mediator/med_phases_prep_atm_mod.F90 index c4d872d1d..bcdf2ea42 100644 --- a/mediator/med_phases_prep_atm_mod.F90 +++ b/mediator/med_phases_prep_atm_mod.F90 @@ -258,7 +258,8 @@ subroutine med_phases_prep_atm_enthalpy_correction (gcomp, hcorr, rc) ! Note that this is only called if the following fields are in FBExp(compocn) ! 'Faxa_rain','Foxx_hrain','Faxa_snow' ,'Foxx_hsnow', ! 'Foxx_evap','Foxx_hevap','Foxx_hcond','Foxx_rofl', - ! 'Foxx_hrofl','Foxx_rofi','Foxx_hrofi' + ! 'Foxx_hrofl','Foxx_rofi','Foxx_hrofi','Foxx_rofl_glc', + ! 'Foxx_hrofl_glc','Foxx_rofi_glc','Foxx_hrofi_glc' use ESMF , only : ESMF_VMAllreduce, ESMF_GridCompGet, ESMF_REDUCE_SUM use ESMF , only : ESMF_VM diff --git a/mediator/med_phases_prep_ocn_mod.F90 b/mediator/med_phases_prep_ocn_mod.F90 index d911d93e1..888113611 100644 --- a/mediator/med_phases_prep_ocn_mod.F90 +++ b/mediator/med_phases_prep_ocn_mod.F90 @@ -97,6 +97,8 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) real(r8), pointer :: hcond(:) real(r8), pointer :: rofl(:), hrofl(:) real(r8), pointer :: rofi(:), hrofi(:) + real(r8), pointer :: rofl_glc(:), hrofl_glc(:) + real(r8), pointer :: rofi_glc(:), hrofi_glc(:) real(r8), pointer :: areas(:) real(r8), allocatable :: hcorr(:) type(med_fldlist_type), pointer :: fldList @@ -156,20 +158,24 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) !--------------------------------------- !--- custom calculations !--------------------------------------- - ! compute enthaly associated with rain, snow, condensation and liquid river runoff + ! compute enthalpy associated with rain, snow, condensation and liquid river & glc runoff ! the sea-ice model already accounts for the enthalpy flux (as part of melth), so ! enthalpy from meltw **is not** included below - if ( FB_fldchk(is_local%wrap%FBExp(compocn), 'Faxa_rain' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrain' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Faxa_snow' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hsnow' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_evap' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hevap' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hcond' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_rofl' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofl' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_rofi' , rc=rc) .and. & - FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofi' , rc=rc)) then + if ( FB_fldchk(is_local%wrap%FBExp(compocn), 'Faxa_rain' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrain' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Faxa_snow' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hsnow' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_evap' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hevap' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hcond' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_rofl' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofl' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_rofi' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofi' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Forr_rofl_glc' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofl_glc' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Forr_rofi_glc' , rc=rc) .and. & + FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_hrofi_glc' , rc=rc)) then call FB_GetFldPtr(is_local%wrap%FBImp(compocn,compocn), 'So_t', tocn, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -201,6 +207,16 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Foxx_hrofi', hrofi, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return + call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Forr_rofl_glc' , rofl_glc, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Foxx_hrofl_glc', hrofl_glc, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + + call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Forr_rofi_glc' , rofi_glc, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Foxx_hrofi_glc', hrofi_glc, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + do n = 1,size(tocn) ! Need max to ensure that will not have an enthalpy contribution if the water is below 0C hrain(n) = max((tocn(n) - shr_const_tkfrz), 0._r8) * rain(n) * shr_const_cpsw @@ -209,6 +225,8 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) hcond(n) = max((tocn(n) - shr_const_tkfrz), 0._r8) * max(evap(n), 0._r8) * shr_const_cpsw hrofl(n) = max((tocn(n) - shr_const_tkfrz), 0._r8) * rofl(n) * shr_const_cpsw hrofi(n) = min((tocn(n) - shr_const_tkfrz), 0._r8) * rofi(n) * shr_const_cpsw + hrofl_glc(n) = max((tocn(n) - shr_const_tkfrz), 0._r8) * rofl_glc(n) * shr_const_cpsw + hrofi_glc(n) = min((tocn(n) - shr_const_tkfrz), 0._r8) * rofi_glc(n) * shr_const_cpsw end do ! Determine enthalpy correction factor that will be added to the sensible heat flux sent to the atm @@ -220,7 +238,7 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) glob_area_inv = 1._r8 / (4._r8 * shr_const_pi) areas => is_local%wrap%mesh_info(compocn)%areas do n = 1,size(tocn) - hcorr(n) = (hrain(n) + hsnow(n) + hcond(n) + hevap(n) + hrofl(n) + hrofi(n)) * & + hcorr(n) = (hrain(n) + hsnow(n) + hcond(n) + hevap(n) + hrofl(n) + hrofi(n) + hrofl_glc(n) + hrofi_glc(n)) * & areas(n) * glob_area_inv end do call med_phases_prep_atm_enthalpy_correction(gcomp, hcorr, rc) From 5adf83aa59447efdfbc4783eae56f5e2c93d8950 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 31 Jul 2024 17:14:52 -0600 Subject: [PATCH 08/12] nan was picked up in pslv field on first pass --- mediator/med_methods_mod.F90 | 4 ++-- mediator/med_phases_prep_ocn_mod.F90 | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mediator/med_methods_mod.F90 b/mediator/med_methods_mod.F90 index d4bdab2a7..1634e7523 100644 --- a/mediator/med_methods_mod.F90 +++ b/mediator/med_methods_mod.F90 @@ -2609,6 +2609,7 @@ subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc) do index=1,fieldCount call med_methods_FB_getNameN(FB, index, fieldname, rc) if (chkerr(rc,__LINE__,u_FILE_u)) return + call ESMF_FieldBundleGet(FB, fieldName=fieldname, field=field, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return call ESMF_FieldGet(field, rank=fieldrank, name=fieldname, rc=rc) @@ -2632,9 +2633,8 @@ subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc) if (nanfound) then call ESMF_LogWrite('ABORTING JOB', ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u) rc = ESMF_FAILURE - return end if - + end subroutine med_methods_FB_check_for_nans !----------------------------------------------------------------------------- diff --git a/mediator/med_phases_prep_ocn_mod.F90 b/mediator/med_phases_prep_ocn_mod.F90 index d911d93e1..44512d58b 100644 --- a/mediator/med_phases_prep_ocn_mod.F90 +++ b/mediator/med_phases_prep_ocn_mod.F90 @@ -266,6 +266,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc) ! local variables type(InternalState) :: is_local integer :: ncnt + logical, save :: first_call = .true. character(len=*),parameter :: subname='(med_phases_prep_ocn_avg)' !--------------------------------------- @@ -306,9 +307,10 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Check for nans in fields export to ocn - call FB_check_for_nans(is_local%wrap%FBExp(compocn), maintask, logunit, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - + if(.not. first_call) then + call FB_check_for_nans(is_local%wrap%FBExp(compocn), maintask, logunit, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + endif ! zero accumulator is_local%wrap%ExpAccumOcnCnt = 0 call FB_reset(is_local%wrap%FBExpAccumOcn, value=czero, rc=rc) @@ -320,6 +322,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) end if call t_stopf('MED:'//subname) + first_call = .false. end subroutine med_phases_prep_ocn_avg From 6851c9db196322a925224569ec308bc0a3d01a77 Mon Sep 17 00:00:00 2001 From: Brian Dobbins Date: Fri, 2 Aug 2024 12:39:02 -0600 Subject: [PATCH 09/12] Changes the default PIO format from 64bit_offset to 64bit_data --- cime_config/config_component.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 33add8b2b..15667ca74 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -1986,15 +1986,15 @@ https://www.unidata.ucar.edu/software/netcdf/docs/data_type.html - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset - 64bit_offset + 64bit_data + 64bit_data + 64bit_data + 64bit_data + 64bit_data + 64bit_data + 64bit_data + 64bit_data + 64bit_data From a02f2ef333676a832702df4751bf25f62c7e737f Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Mon, 5 Aug 2024 09:08:49 -0600 Subject: [PATCH 10/12] Remove POP2 references from config_component_cesm --- cime_config/config_component_cesm.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cime_config/config_component_cesm.xml b/cime_config/config_component_cesm.xml index ca9b9a7f9..a45383f8b 100644 --- a/cime_config/config_component_cesm.xml +++ b/cime_config/config_component_cesm.xml @@ -111,8 +111,6 @@ CO2A CO2A CO2A - CO2A - CO2A CO2A CO2A CO2C @@ -238,15 +236,12 @@ - 24 24 24 - 24 - 144 24 24 24 @@ -332,11 +327,6 @@ 24 24 - 1 - 24 - 24 - 48 - 48 1 24 @@ -388,7 +378,6 @@ integer 8 - 1 $ATM_NCPL $ATM_NCPL $ATM_NCPL @@ -477,11 +466,8 @@ TIGHT OPTION2 - OPTION2 OPTION1 OPTION1 - OPTION1 - OPTION1 OPTION2 OPTION2 OPTION2 @@ -558,8 +544,6 @@ 367.0 284.317 - 284.317 - 284.7 run_co2 env_run.xml From 2fba8e8d68ab79f1efa3ee715278e95df6bbd233 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 7 Aug 2024 08:46:05 -0600 Subject: [PATCH 11/12] add CASE_GIT_REPOSITORY variable --- cime_config/config_component.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 15667ca74..0d06f2350 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -2412,6 +2412,19 @@ + + + + + + char + + case_git + env_build.xml + Remote git repository used for this case + + + From a65d1d0a9fe97c79c4c915aafc33f800bf677672 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 7 Aug 2024 13:49:43 -0600 Subject: [PATCH 12/12] set xgrid to default --- cime_config/namelist_definition_drv.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index 222a15b26..a1857b935 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -929,7 +929,8 @@ default: ogrid - ogrid + xgrid + ogrid