File indexing completed on 2022-10-26 05:09:35 UTC
view on githubraw file Latest commit cc9097e5 on 2022-10-26 02:15:19 UTC
fda3710353 Oliv*0001 #include "LONGSTEP_OPTIONS.h"
0002
0003
0004
0005
0006
0007 SUBROUTINE LONGSTEP_FORCING_SURF(
0008 I bi, bj, iMin, iMax, jMin, jMax,
cc9097e522 Oliv*0009 I myTime, myIter, myThid )
fda3710353 Oliv*0010
0011
0012
0013
0014
0015
0016
0017 IMPLICIT NONE
0018 #include "SIZE.h"
0019 #include "EEPARAMS.h"
0020 #include "PARAMS.h"
cc9097e522 Oliv*0021
0022
0023
fda3710353 Oliv*0024
0025 #include "LONGSTEP.h"
cc9097e522 Oliv*0026 #ifdef ALLOW_PTRACERS
0027 # include "PTRACERS_SIZE.h"
0028 # include "PTRACERS_PARAMS.h"
0029 # include "PTRACERS_FIELDS.h"
0030 #endif
fda3710353 Oliv*0031
0032
0033
0034
0035
0036
0037 INTEGER bi, bj, iMin, iMax, jMin, jMax
0038 _RL myTime
0039 INTEGER myIter
0040 INTEGER myThid
0041
0042 #ifdef ALLOW_LONGSTEP
cc9097e522 Oliv*0043 #ifdef ALLOW_PTRACERS
fda3710353 Oliv*0044
0045
0046
0047
0048
0049 INTEGER i, j
0050 INTEGER iTrc, ks
0051
0052
0053 IF ( usingPCoords ) THEN
0054 ks = Nr
0055 ELSE
0056 ks = 1
0057 ENDIF
0058
0059
0060 DO iTrc=1,PTRACERS_numInUse
0061 DO j = jMin, jMax
0062 DO i = iMin, iMax
0063 surfaceForcingPTr(i,j,bi,bj,iTrc) =
0064 & 0. _d 0
0065
0066 ENDDO
0067 ENDDO
0068 ENDDO
0069
0070 #ifdef EXACT_CONSERV
0071 IF ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
0072 & .AND. useRealFreshWaterFlux ) THEN
0073
0074 DO iTrc=1,PTRACERS_numInUse
0075
0076
0077
0078
0079
0080
0081
0082 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
0083 DO j = jMin, jMax
0084 DO i = iMin, iMax
0085 surfaceForcingPTr(i,j,bi,bj,iTrc) =
0086 & surfaceForcingPTr(i,j,bi,bj,iTrc)
0087 & + LS_fwFlux(i,j,bi,bj)
0088 & *( PTRACERS_EvPrRn(iTrc) - pTracer(i,j,ks,bi,bj,iTrc) )
0089 & *mass2rUnit
0090 ENDDO
0091 ENDDO
0092 ENDIF
0093
0094 ENDDO
0095
0096
0097 ELSE
0098 #else /* EXACT_CONSERV */
0099 IF (.TRUE.) THEN
0100 #endif /* EXACT_CONSERV */
0101
0102
0103
0104
0105 IF (convertFW2Salt .EQ. -1.) THEN
0106
0107
0108 DO iTrc=1,PTRACERS_numInUse
0109
0110 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
0111
0112
0113
0114
0115
0116 DO j = jMin, jMax
0117 DO i = iMin, iMax
0118 surfaceForcingPTr(i,j,bi,bj,iTrc) =
0119 & surfaceForcingPTr(i,j,bi,bj,iTrc)
0120 & + LS_fwFlux(i,j,bi,bj)
0121 & *( pTracer(i,j,ks,bi,bj,iTrc) - PTRACERS_EvPrRn(iTrc) )
0122 & *mass2rUnit
0123 ENDDO
0124 ENDDO
0125 ENDIF
0126
0127 ENDDO
0128
0129 ELSE
0130
0131
0132 DO iTrc=1,PTRACERS_numInUse
0133
0134 IF (PTRACERS_EvPrRn(iTrc).NE.UNSET_RL) THEN
0135
0136
0137
0138
0139
0140 DO j = jMin, jMax
0141 DO i = iMin, iMax
0142 surfaceForcingPTr(i,j,bi,bj,iTrc) =
0143 & surfaceForcingPTr(i,j,bi,bj,iTrc)
0144 & + LS_fwFlux(i,j,bi,bj)
0145 & *( PTRACERS_ref(ks,iTrc) - PTRACERS_EvPrRn(iTrc) )
0146 & *mass2rUnit
0147 ENDDO
0148 ENDDO
0149 ENDIF
0150
0151 ENDDO
0152
0153
0154 ENDIF
0155
0156 ENDIF
0157
0158
0159
cc9097e522 Oliv*0160 #endif /* ALLOW_PTRACERS */
fda3710353 Oliv*0161 #endif /* ALLOW_LONGSTEP */
0162
0163 RETURN
0164 END