--- MITgcm/verification/fizhi-gridalt-hs/code/fizhi_init_vars.F 2005/05/05 21:27:39 1.3 +++ MITgcm/verification/fizhi-gridalt-hs/code/fizhi_init_vars.F 2012/03/27 15:49:37 1.4 @@ -1,15 +1,15 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/fizhi-gridalt-hs/code/fizhi_init_vars.F,v 1.3 2005/05/05 21:27:39 molod Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/fizhi-gridalt-hs/code/fizhi_init_vars.F,v 1.4 2012/03/27 15:49:37 jmc Exp $ C $Name: $ #include "FIZHI_OPTIONS.h" - subroutine fizhi_init_vars (myThid) + SUBROUTINE FIZHI_INIT_VARS (myThid) c----------------------------------------------------------------------- c Routine to initialise the fizhi state. -c +c c Input: myThid - Process number calling this routine c -c Notes: -c 1) For a Cold Start - +c Notes: +c 1) For a Cold Start - c This routine takes the initial condition on the dynamics grid c and interpolates to the physics grid to initialize the state c variables that are on both grids. It initializes the variables @@ -20,7 +20,7 @@ c c Calls: dyn2phys (x4) c----------------------------------------------------------------------- - implicit none + IMPLICIT NONE #include "SIZE.h" #include "fizhi_SIZE.h" #include "fizhi_land_SIZE.h" @@ -35,7 +35,7 @@ #include "PARAMS.h" #include "chronos.h" - integer myThid + INTEGER myThid c pe on dynamics and physics grid refers to bottom edge _RL pephy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys+1,nSx,nSy) @@ -45,10 +45,10 @@ _RL vdyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) _RL tempphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) - integer i, j, L, bi, bj, Lbotij - integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 - logical alarm - external alarm + INTEGER i, j, L, bi, bj, Lbotij + INTEGER im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 + LOGICAL alarm + EXTERNAL alarm im1 = 1-OLx im2 = sNx+OLx @@ -63,7 +63,7 @@ c All Fizhi alarms must be on for the first time step of a segment if( .not.alarm('moist') .or. .not.alarm('turb') .or. - . .not.alarm('radsw') .or. .not.alarm('radlw') ) then + & .not.alarm('radsw') .or. .not.alarm('radlw') ) then print *,' Cant Start Fizhi experiment at ',nymd,' ',nhms stop endif @@ -86,21 +86,21 @@ enddo do j = 1,sNy do i = 1,sNx - Lbotij = ksurfC(i,j,bi,bj) - if(Lbotij.ne.0.) - . pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) + Lbotij = kSurfC(i,j,bi,bj) + if(Lbotij.ne.0.) + & pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) enddo enddo do j = 1,sNy do i = 1,sNx - Lbotij = ksurfC(i,j,bi,bj) + Lbotij = kSurfC(i,j,bi,bj) do L = Lbotij+1,Nr+1 pedyn(i,j,L,bi,bj) = pedyn(i,j,L-1,bi,bj) - - . drF(L-1)*hfacC(i,j,L-1,bi,bj) + & drF(L-1)*hfacC(i,j,L-1,bi,bj) enddo c Do not use a zero field as the top edge pressure for interpolation if(pedyn(i,j,Nr+1,bi,bj).lt.1.e-5) - . pedyn(i,j,Nr+1,bi,bj) = 1.e-5 + & pedyn(i,j,Nr+1,bi,bj) = 1.e-5 enddo enddo C Build pressures on physics grid @@ -112,7 +112,7 @@ enddo c Do not use a zero field as the top edge pressure for interpolation if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5) - . pephy(i,j,Nrphys+1,bi,bj) = 1.e-5 + & pephy(i,j,Nrphys+1,bi,bj) = 1.e-5 enddo enddo c @@ -123,24 +123,24 @@ do j = 1,sNy do i = 1,sNx windphy(i,j,L,bi,bj) = 0.025 * - . log((pephy(i,j,1,bi,bj)-pephy(i,j,L+1,bi,bj))*10.) + & log((pephy(i,j,1,bi,bj)-pephy(i,j,L+1,bi,bj))*10.) enddo enddo enddo enddo enddo - + c Create initial fields on phys. grid - Move Dynamics u and v to A-Grid call CtoA(myThid,uvel,vvel,maskW,maskS,im1,im2,jm1,jm2,Nr, - . Nsx,Nsy,1,sNx,1,sNy,udyntemp,vdyntemp) + & nSx,nSy,1,sNx,1,sNy,udyntemp,vdyntemp) do bj = myByLo(myThid), myByHi(myThid) do bi = myBxLo(myThid), myBxHi(myThid) c Create initial fields on phys. grid - interpolate from dyn. grid - call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, - . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy) + call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,nSx,nSy, + & 1,sNx,1,sNy,bi,bj,windphy,pephy,kSurfC,Nrphys,nlperdyn,1,tempphy) c Note: Interpolation gives bottom-up arrays (level 1 is bottom), c Physics works top-down. so -> need to flip arrays do L = 1,Nrphys @@ -150,8 +150,8 @@ enddo enddo enddo - call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, - . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy) + call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,nSx,nSy, + & 1,sNx,1,sNy,bi,bj,windphy,pephy,kSurfC,Nrphys,nlperdyn,1,tempphy) do L = 1,Nrphys do j = 1,sNy do i = 1,sNx @@ -159,8 +159,8 @@ enddo enddo enddo - call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, - . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) + call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,nSx,nSy, + & 1,sNx,1,sNy,bi,bj,windphy,pephy,kSurfC,Nrphys,nlperdyn,0,tempphy) do L = 1,Nrphys do j = 1,sNy do i = 1,sNx @@ -169,8 +169,8 @@ enddo enddo - call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, - . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) + call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,nSx,nSy, + & 1,sNx,1,sNy,bi,bj,windphy,pephy,kSurfC,Nrphys,nlperdyn,0,tempphy) do L = 1,Nrphys do j = 1,sNy do i = 1,sNx @@ -223,8 +223,9 @@ print *,' Need initial Values for TKE - dont have them! ' stop endif + turbStart(bi,bj) = .TRUE. -c Now initialize vegetation tile land state too - tcanopy, etc... +c Now initialize vegetation tile land state too - tcanopy, etc... c call fizhi_init_vegsurftiles( nymd,nhms, 'D', myThid ) c Now initialize land state too - tcanopy, etc... SET FOR NOW, c READ CLIM FOR REAL @@ -279,13 +280,18 @@ ELSE print *,' In fizhi_init_vars: Read from restart ' - + C-- Read fizhi package state variables from pickup file call fizhi_read_pickup( nIter0, myThid ) CALL FIZHI_READ_VEGTILES( nIter0, 'D', myThid ) + do bj = myByLo(myThid), myByHi(myThid) + do bi = myBxLo(myThid), myBxHi(myThid) + turbStart(bi,bj) = .FALSE. + enddo + enddo ENDIF - return - end + RETURN + END