From f72f2193c95ba046cfb57a7e19aefb05c42f4e54 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Thu, 19 Apr 2018 17:57:27 -0600 Subject: [PATCH] updates to have data model avect info print correctly --- .../data_comps/datm/nuopc/datm_comp_nuopc.F90 | 16 ++-- .../data_comps/dice/nuopc/dice_comp_nuopc.F90 | 16 ++-- .../data_comps/dlnd/nuopc/dlnd_comp_nuopc.F90 | 16 ++-- .../data_comps/docn/nuopc/docn_comp_nuopc.F90 | 16 ++-- .../data_comps/drof/nuopc/drof_comp_nuopc.F90 | 16 ++-- .../data_comps/dwav/nuopc/dwav_comp_nuopc.F90 | 16 ++-- src/drivers/nuopc/cime_driver/esm.F90 | 14 ++- src/drivers/nuopc/cime_flds/esmFlds.F90 | 88 +++++++------------ 8 files changed, 102 insertions(+), 96 deletions(-) diff --git a/src/components/data_comps/datm/nuopc/datm_comp_nuopc.F90 b/src/components/data_comps/datm/nuopc/datm_comp_nuopc.F90 index 7b7f171818b..75c65e46547 100644 --- a/src/components/data_comps/datm/nuopc/datm_comp_nuopc.F90 +++ b/src/components/data_comps/datm/nuopc/datm_comp_nuopc.F90 @@ -502,9 +502,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='initial diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='initial diag'//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -650,9 +652,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='run diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='run diag'//':AV', pe=localPet) + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (my_task == master_task) then diff --git a/src/components/data_comps/dice/nuopc/dice_comp_nuopc.F90 b/src/components/data_comps/dice/nuopc/dice_comp_nuopc.F90 index b455c63eb1d..3a7a47bf0b7 100644 --- a/src/components/data_comps/dice/nuopc/dice_comp_nuopc.F90 +++ b/src/components/data_comps/dice/nuopc/dice_comp_nuopc.F90 @@ -481,9 +481,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -620,9 +622,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (my_task == master_task) then diff --git a/src/components/data_comps/dlnd/nuopc/dlnd_comp_nuopc.F90 b/src/components/data_comps/dlnd/nuopc/dlnd_comp_nuopc.F90 index c036a6a14d6..7da4ed23431 100644 --- a/src/components/data_comps/dlnd/nuopc/dlnd_comp_nuopc.F90 +++ b/src/components/data_comps/dlnd/nuopc/dlnd_comp_nuopc.F90 @@ -433,9 +433,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='initial diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='initial diag'//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -562,9 +564,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='run diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='run diag'//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (master_task) then diff --git a/src/components/data_comps/docn/nuopc/docn_comp_nuopc.F90 b/src/components/data_comps/docn/nuopc/docn_comp_nuopc.F90 index a370028d904..f2b5fb35f69 100644 --- a/src/components/data_comps/docn/nuopc/docn_comp_nuopc.F90 +++ b/src/components/data_comps/docn/nuopc/docn_comp_nuopc.F90 @@ -469,9 +469,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -611,9 +613,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (my_task == master_task) then diff --git a/src/components/data_comps/drof/nuopc/drof_comp_nuopc.F90 b/src/components/data_comps/drof/nuopc/drof_comp_nuopc.F90 index b412f262f96..2bafa7992c9 100644 --- a/src/components/data_comps/drof/nuopc/drof_comp_nuopc.F90 +++ b/src/components/data_comps/drof/nuopc/drof_comp_nuopc.F90 @@ -457,9 +457,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -594,9 +596,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr=subname//':AV', pe=localPet) + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (my_task == master_task) then diff --git a/src/components/data_comps/dwav/nuopc/dwav_comp_nuopc.F90 b/src/components/data_comps/dwav/nuopc/dwav_comp_nuopc.F90 index 64239fa4db9..8232f0b961e 100644 --- a/src/components/data_comps/dwav/nuopc/dwav_comp_nuopc.F90 +++ b/src/components/data_comps/dwav/nuopc/dwav_comp_nuopc.F90 @@ -430,9 +430,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='initial diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='initial diag'//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif #ifdef USE_ESMF_METADATA @@ -560,9 +562,11 @@ subroutine ModelAdvance(gcomp, rc) !-------------------------------- if (dbug > 1) then - call mct_aVect_info(2, d2x, istr='initial diag'//':AV', pe=localPet) - call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + if (my_task == master_task) then + call mct_aVect_info(2, d2x, istr='initial diag'//':AV') + end if + call shr_nuopc_methods_State_diagnose(exportState,subname//':ES',rc=rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return endif if (master_task) then diff --git a/src/drivers/nuopc/cime_driver/esm.F90 b/src/drivers/nuopc/cime_driver/esm.F90 index ac816f6a9cf..29ad7882ac0 100644 --- a/src/drivers/nuopc/cime_driver/esm.F90 +++ b/src/drivers/nuopc/cime_driver/esm.F90 @@ -760,11 +760,11 @@ subroutine SetModelServices(driver, rc) write(logunit,*) trim(subname)//":wav_present="//trim(wav_present) write(logunit,*) trim(subname)//":glc_present="//trim(glc_present) write(logunit,*) trim(subname)//":med_present="//trim(med_present) - end if - ! Print out colon delimited string of fields from mediator log file - call esmFlds_Concat(child, logunit, rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + ! Print out colon delimited string of fields from mediator log file + call esmFlds_Concat(logunit, rc) + if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + end if else @@ -841,6 +841,12 @@ subroutine SetRunSequence(driver, rc) call NUOPC_DriverIngestRunSequence(driver, runSeqFF, autoAddConnectors=.true., rc=rc) if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return + call NUOPC_DriverPrint(driver, orderflag=.true.) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, & + file=__FILE__)) & + return ! bail out + if (mastertask) then call NUOPC_FreeFormatPrint(runSeqFF, rc=rc) if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return diff --git a/src/drivers/nuopc/cime_flds/esmFlds.F90 b/src/drivers/nuopc/cime_flds/esmFlds.F90 index 0de3ba9ffa6..58173f79469 100644 --- a/src/drivers/nuopc/cime_flds/esmFlds.F90 +++ b/src/drivers/nuopc/cime_flds/esmFlds.F90 @@ -164,6 +164,8 @@ subroutine esmFlds_Init(gcomp, rc) character(len=*), parameter :: subname='(shr_nuopc_fldList_Init)' !-------------------------------------- + rc = ESMF_SUCCESS + call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return @@ -2528,91 +2530,65 @@ end subroutine esmFlds_Init !================================================================================ - subroutine esmFlds_Concat(gcomp, logunit, rc) + subroutine esmFlds_Concat(logunit, rc) !---------------------------------------------------------------------------- ! creation of colon delimited field list !---------------------------------------------------------------------------- ! input/output variables - type(ESMF_GridComp) :: gcomp integer, intent(in) :: logunit integer, intent(inout) :: rc ! local variables - type(ESMF_VM) :: vm - integer :: localPet - logical :: mastertask character(CXX) :: concatFr, concatTo character(len=*), parameter :: subname='(esmFlds_Concat)' !-------------------------------------- - call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return - - call ESMF_VMGet(vm, localPet=localPet, rc=rc) - if (shr_nuopc_methods_ChkErr(rc,__LINE__,u_FILE_u)) return - - mastertask = .false. - if (localPet == 0) mastertask=.true. + rc = ESMF_SUCCESS - ! Determine character list of fields concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(compatm), fldListTo(compatm), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_a2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2a = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_a2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2a = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(complnd), fldListTo(complnd), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_l2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2l = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_l2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2l = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(compice), fldListTo(compice), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_i2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2i = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_i2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2i = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(compocn), fldListTo(compocn), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_o2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2o = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_o2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2o = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(compglc), fldListTo(compglc), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_g2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2g = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_g2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2g = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(comprof), fldListTo(comprof), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_r2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_r2x = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_r2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_r2x = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' concatFr = ''; concatTo = '' call shr_nuopc_fldList_Concat(fldListFr(compwav), fldListTo(compwav), concatFr, concatTo, flds_scalar_name) - if (mastertask) then - write(logunit, "(A)") subname//': flds_w2x = ',trim(concatFr) - write(logunit, "(A)") '-------------------------------------------------' - write(logunit, "(A)") subname//': flds_x2w = ',trim(concatTo) - write(logunit, "(A)") '-------------------------------------------------' - end if + write(logunit, "(A)") subname//': flds_w2x = ',trim(concatFr) + write(logunit, "(A)") '-------------------------------------------------' + write(logunit, "(A)") subname//': flds_x2w = ',trim(concatTo) + write(logunit, "(A)") '-------------------------------------------------' end subroutine esmFlds_Concat