| 72 |
C-- Interpolate and add to anomaly |
C-- Interpolate and add to anomaly |
| 73 |
DO j=1,sNy |
DO j=1,sNy |
| 74 |
|
|
| 75 |
IF (ntTypeRelax.EQ.0) THEN |
IF (ntTypeRelax .EQ. 0) THEN |
| 76 |
lambdaTheta = r_tauThetaRelax |
lambdaTheta = r_tauThetaRelax |
| 77 |
ELSE |
ELSE |
| 78 |
lambdaTheta = r_tauThetaRelax/ |
lambdaTheta = r_tauThetaRelax/ |
| 79 |
& max(cos(1.5D0*yC(1,j,1,1)*deg2rad),0.D0) |
& max(cos(1.5 _d 0*yC(1,j,1,1)*deg2rad),0. _d 0) |
| 80 |
ENDIF |
ENDIF |
| 81 |
IF (nsTypeRelax.EQ.0) THEN |
IF (nsTypeRelax .EQ. 0) THEN |
| 82 |
lambdaSalt = r_tauSaltRelax |
lambdaSalt = r_tauSaltRelax |
| 83 |
ELSE |
ELSE |
| 84 |
lambdaSalt = r_tauSaltRelax/ |
lambdaSalt = r_tauSaltRelax/ |
| 85 |
& max(cos(1.5D0*yC(1,j,1,1)*deg2rad),0.D0) |
& max(cos(1.5 _d 0*yC(1,j,1,1)*deg2rad),0. _d 0) |
| 86 |
ENDIF |
ENDIF |
| 87 |
|
|
| 88 |
DO i=1,sNx |
DO i=1,sNx |
| 89 |
|
|
| 90 |
IF (maskC(i,j,1,1,1).EQ.1.) THEN |
IF (maskC(i,j,1,1,1) .EQ. 1.) THEN |
| 91 |
sstRelax(i,j)= (wght0*sst0(i,j,1,1) + wght1*sst1(i,j,1,1)) |
sstRelax(i,j)= (wght0*sst0(i,j,1,1) + wght1*sst1(i,j,1,1)) |
| 92 |
sssRelax(i,j)= (wght0*sss0(i,j,1,1) + wght1*sss1(i,j,1,1)) |
sssRelax(i,j)= (wght0*sss0(i,j,1,1) + wght1*sss1(i,j,1,1)) |
| 93 |
|
|
| 94 |
C Next lines: linearly phase out SST restoring between 2C and -1C |
C Next lines: linearly phase out SST restoring between 2C and -1C |
| 95 |
C ONLY if seaice is present |
C ONLY if seaice is present |
| 96 |
IF ((sstRelax(i,j).GT.2.0).OR. |
IF ((sstRelax(i,j).GT.2. _d 0).OR. |
| 97 |
& (iceMask(i,j,1,1).EQ.0.D0)) THEN |
& (iceMask(i,j,1,1) .EQ. 0. _d 0)) THEN |
| 98 |
nearIce=1.0 |
nearIce=1.0 |
| 99 |
ELSEIF (sstRelax(i,j).LE.-1.0) THEN |
ELSEIF (sstRelax(i,j) .LE. -1. _d 0) THEN |
| 100 |
nearIce=0.0 |
nearIce=0.0 |
| 101 |
ELSE |
ELSE |
| 102 |
nearIce=(sstRelax(i,j)+1.0)/3.0 |
nearIce=(sstRelax(i,j)+1.0)/3.0 |
| 103 |
endif |
endif |
| 104 |
|
|
| 105 |
IF (iceMask(i,j,1,1).GT.0.D0) THEN |
C IF (iceMask(i,j,1,1) .GT. 0. _d 0) THEN |
| 106 |
PRINT *,'In relax at, sst :',i,j,sstRelax(i,j) |
C PRINT *,'In relax at, sst :',i,j,sstRelax(i,j) |
| 107 |
PRINT *,'Nearice = ',nearIce |
C PRINT *,'Nearice = ',nearIce |
| 108 |
ENDIF |
C ENDIF |
| 109 |
qrelflux= lambdaTheta*(sstFromOcn(i,j)-sstRelax(i,j))/ |
qrelflux= lambdaTheta*(sstFromOcn(i,j)-sstRelax(i,j))/ |
| 110 |
& (recip_Cp*recip_rhoNil*recip_drF(1))*nearIce |
& (recip_Cp*recip_rhoNil*recip_drF(1))*nearIce |
| 111 |
|
|
| 115 |
frelflux= -lambdaSalt*(sssFromOcn(i,j)-sssRelax(i,j))/ |
frelflux= -lambdaSalt*(sssFromOcn(i,j)-sssRelax(i,j))/ |
| 116 |
& (convertFW2Salt *recip_drF(1))*nearIce |
& (convertFW2Salt *recip_drF(1))*nearIce |
| 117 |
|
|
| 118 |
if ((i.eq.JBUGI).and.(j.eq.JBUGJ)) then |
C if ((i.eq.JBUGI).and.(j.eq.JBUGJ)) then |
| 119 |
print *,'Frelflux:',frelflux,sssFromOcn(i,j)-sssRelax(i,j) |
C print *,'Frelflux:',frelflux,sssFromOcn(i,j)-sssRelax(i,j) |
| 120 |
print *,'Qrelflux:',qrelflux,sstFromOcn(i,j)-sstRelax(i,j) |
C print *,'Qrelflux:',qrelflux,sstFromOcn(i,j)-sstRelax(i,j) |
| 121 |
print *,'sss relax:',sssRelax(i,j),sss0(i,j,1,1),sss1(i,j,1,1) |
C print *,'sss relax:',sssRelax(i,j),sss0(i,j,1,1),sss1(i,j,1,1) |
| 122 |
print *,'sst relax:',sstRelax(i,j),sst0(i,j,1,1),sst1(i,j,1,1) |
C print *,'sst relax:',sstRelax(i,j),sst0(i,j,1,1),sst1(i,j,1,1) |
| 123 |
print *,'ctocn: ',ctocn(JBUGJ+1) |
C print *,'ctocn: ',ctocn(JBUGJ+1) |
| 124 |
endif |
C endif |
| 125 |
|
|
| 126 |
C or use actual salt instead of convertFW2salt above? |
C or use actual salt instead of convertFW2salt above? |
| 127 |
|
|
| 128 |
IF (frelflux.GT.0.D0) THEN |
IF (frelflux .GT. 0. _d 0) THEN |
| 129 |
evapo_2D(i,j)= evapo_2D(i,j) - frelflux |
evapo_2D(i,j)= evapo_2D(i,j) - frelflux |
| 130 |
IF (iceMask(i,j,1,1).GT.0. _d 0) |
IF (iceMask(i,j,1,1).GT.0. _d 0) |
| 131 |
& evapi_2D(i,j)= evapi_2D(i,j) - frelflux |
& evapi_2D(i,j)= evapi_2D(i,j) - frelflux |
| 135 |
& precipi_2D(i,j)= precipi_2D(i,j) + frelflux |
& precipi_2D(i,j)= precipi_2D(i,j) + frelflux |
| 136 |
ENDIF |
ENDIF |
| 137 |
|
|
| 138 |
C IF (iceMask(i,j,1,1).GT.0.D0) THEN |
C IF (iceMask(i,j,1,1) .GT. 0. _d 0) THEN |
| 139 |
C PRINT *,'Frelflux',frelflux,precipi_2D(i,j),atm_precip(j+1) |
C PRINT *,'Frelflux',frelflux,precipi_2D(i,j),atm_precip(j+1) |
| 140 |
C ENDIF |
C ENDIF |
| 141 |
|
|
| 148 |
ENDDO |
ENDDO |
| 149 |
ENDIF |
ENDIF |
| 150 |
|
|
| 151 |
PRINT *,'***bottom of relaxadd',wght0,wght1,intime0,intime1 |
C PRINT *,'***bottom of relaxadd',wght0,wght1,intime0,intime1 |
| 152 |
PRINT *,'evapo_2d: ',evapo_2D(JBUGI,JBUGJ) |
C PRINT *,'evapo_2d: ',evapo_2D(JBUGI,JBUGJ) |
| 153 |
PRINT *,'precipo_2d: ',precipo_2D(JBUGI,JBUGJ) |
C PRINT *,'precipo_2d: ',precipo_2D(JBUGI,JBUGJ) |
| 154 |
PRINT *,'qneto_2d: ',qneto_2D(JBUGI,JBUGJ) |
C PRINT *,'qneto_2d: ',qneto_2D(JBUGI,JBUGJ) |
| 155 |
PRINT *,'SStfrom Ocn: ',sstfromocn(JBUGI,JBUGJ) |
C PRINT *,'SStfrom Ocn: ',sstfromocn(JBUGI,JBUGJ) |
| 156 |
PRINT *,'SSSfrom Ocn: ',sssfromocn(JBUGI,JBUGJ) |
C PRINT *,'SSSfrom Ocn: ',sssfromocn(JBUGI,JBUGJ) |
| 157 |
|
|
| 158 |
RETURN |
RETURN |
| 159 |
END |
END |