From 0a28f3fd3c38d6cce1d9bce88401c4415590819d Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Wed, 29 Jan 2020 12:48:30 -0700 Subject: [PATCH] cop required changes --- mod_esmf_ocn_mit.F90 | 94 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 10 deletions(-) diff --git a/mod_esmf_ocn_mit.F90 b/mod_esmf_ocn_mit.F90 index 7954eb0..3e18a84 100644 --- a/mod_esmf_ocn_mit.F90 +++ b/mod_esmf_ocn_mit.F90 @@ -389,9 +389,9 @@ subroutine OCN_SetClock(gcomp, rc) str_year = startdate_1/10000 str_month = mod(startdate_1/100,100) str_day = mod(startdate_1,100) - str_hour = 0 - str_minute = 0 - str_second = 0 + str_hour = startdate_2/10000 + str_minute = mod(startdate_2/100,100) + str_second = mod(startdate_2,100) ! call ESMF_TimeSet(cmpStartTime, & yy=str_year, & @@ -410,6 +410,15 @@ subroutine OCN_SetClock(gcomp, rc) line=__LINE__, file=FILENAME)) return ! cmpStartTime = cmpStartTime+elapsedTime +! + if (localPet == 0) then + call ESMF_TimePrint(cmpStartTime, options="string isofrac", rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=FILENAME)) return + call ESMF_TimeIntervalPrint(elapsedTime, options="string isofrac", rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=FILENAME)) return + end if ! !----------------------------------------------------------------------- ! Set stop time @@ -465,11 +474,11 @@ subroutine OCN_SetClock(gcomp, rc) ! if (cmpStartTime /= dummTime) then if (localPet == 0) then - call ESMF_TimePrint(cmpStartTime, options="string", rc=rc) + call ESMF_TimePrint(cmpStartTime, options="string isofrac", rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=FILENAME)) return -! - call ESMF_TimePrint(dummTime, options="string", rc=rc) + + call ESMF_TimePrint(dummTime, options="string isofrac", rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=FILENAME)) return end if @@ -791,7 +800,7 @@ subroutine OCN_SetGridArrays(gcomp, petCount, localPet, rc) if (p == 1) then models(Iocean)%grid = ESMF_GridCreate(distgrid=distGrid, & indexflag=ESMF_INDEX_GLOBAL,& - name="ocn_grid", & + name="ocn_grid2d", & rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=FILENAME)) return @@ -1152,7 +1161,7 @@ subroutine OCN_SetGridArrays(gcomp, petCount, localPet, rc) !----------------------------------------------------------------------- ! 20 format(" RIVER(",I2.2,") - ",I4,3F8.2," [",I3.3,":",I3.3,"] - ",I4," ",A) - 30 format(" PET(",I3.3,") - DE(",I2.2,") - ", A20, " : ", 4I8) + 30 format(" PET(",I4.4,") - DE(",I2.2,") - ", A20, " : ", 4I8) ! end subroutine OCN_SetGridArrays ! @@ -1990,7 +1999,7 @@ subroutine OCN_Get(gcomp, rc) ! Format definition !----------------------------------------------------------------------- ! - 60 format(' PET(',I3,') - DE(',I2,') - ', A20, ' : ', 4I8) + 60 format(' PET(',I4,') - DE(',I2,') - ', A20, ' : ', 4I8) 70 format(A10,'_',A,'_',I4,'-',I2.2,'-',I2.2,'_',I2.2,'_',I2.2,'_',I1) 80 format(A10,'_',A,'_', & I4,'-',I2.2,'-',I2.2,'_',I2.2,'_',I2.2,'_',I2.2) @@ -2004,7 +2013,8 @@ subroutine OCN_Put(gcomp, rc) ! Used module declarations !----------------------------------------------------------------------- ! - use mod_mit_gcm, only : theta + use mod_mit_gcm, only : theta, salt, uvel, vvel, etan, maskc + use mod_mit_gcm, only : R_low, sflux, hflux ! implicit none ! @@ -2146,6 +2156,22 @@ subroutine OCN_Put(gcomp, rc) jmax = Ny+1 ! select case (trim(adjustl(itemNameList(i)))) + case ('mask2d') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = maskc(ii,jj,1,1,1) + end do + end do + case ('depth') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = R_low(ii,jj,1,1) + end do + end do case ('sst') do jj = 1, sNy do ii = 1, sNx @@ -2154,6 +2180,54 @@ subroutine OCN_Put(gcomp, rc) ptr(iG,jG) = theta(ii,jj,1,1,1) end do end do + case ('ssfc') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = salt(ii,jj,1,1,1) + end do + end do + case ('ssh') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = etan(ii,jj,1,1) + end do + end do + case ('usfc') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = uvel(ii,jj,1,1,1) + end do + end do + case ('vsfc') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = vvel(ii,jj,1,1,1) + end do + end do + case ('empmr') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = sflux(ii,jj,1,1) + end do + end do + case ('lsls') + do jj = 1, sNy + do ii = 1, sNx + iG = myXGlobalLo-1+(bi-1)*sNx+ii + jG = myYGlobalLo-1+(bj-1)*sNy+jj + ptr(iG,jG) = hflux(ii,jj,1,1) + end do + end do end select ! !-----------------------------------------------------------------------