File indexing completed on 2018-03-02 18:37:29 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
09a6f3668a Jeff*0001 #include "ctrparam.h"
0002 #include "ATM2D_OPTIONS.h"
0003
0004
0005 SUBROUTINE CALC_1DTO2D( myThid )
0006
0007
0008
0009
0010
0011
0012 IMPLICIT NONE
0013
0014 #include "ATMSIZE.h"
0015 #include "SIZE.h"
0016 #include "GRID.h"
0017 #include "EEPARAMS.h"
0018
0019
0020 #include "THSICE_VARS.h"
0021
0022
0023 #include "ATM2D_VARS.h"
0024
0025
0026
0027
0028 INTEGER myThid
0029
0030
0031 INTEGER i,j
0032 INTEGER ib,ibj1,ibj2
0033 _RL run_b(sNy)
f67c0bf3c1 Jeff*0034 _RL fv_toC
09a6f3668a Jeff*0035
0036 CALL INIT_2DFLD(myThid)
0037
0038
0039 DO ib=1,numBands
0040 ibj1=1
0041 IF (ib.GT.1) ibj1= rband(ib-1)+1
0042 ibj2=sNy
0043 IF (ib.LT.numBands) ibj2= rband(ib)
0044 run_b(ib)=0. _d 0
0045 DO j=ibj1,ibj2
9274434acc Jean*0046 run_b(ib)=run_b(ib) +
0efd285817 Jeff*0047 & atm_runoff(atm_oc_ind(j))*atm_oc_frac1(j) +
0048 & atm_runoff(atm_oc_ind(j)+1)*atm_oc_frac2(j)
09a6f3668a Jeff*0049 ENDDO
0050 ENDDO
9274434acc Jean*0051
09a6f3668a Jeff*0052 DO j=1,sNy
f67c0bf3c1 Jeff*0053
0054
0055 fv_toC = atm_tauv(tauv_jpt(j)) * tauv_jwght(j) +
7edba25672 Jeff*0056 & atm_tauv(tauv_jpt(j)+1) * (1. _d 0 - tauv_jwght(j))
f67c0bf3c1 Jeff*0057
09a6f3668a Jeff*0058 DO i=1,sNx
0059
0060 IF (maskC(i,j,1,1,1).EQ.1.) THEN
9274434acc Jean*0061
0062 runoff_2D(i,j) = run_b(runIndex(j)) *
09a6f3668a Jeff*0063 & runoffVal(i,j)/rA(i,j,1,1)
9274434acc Jean*0064
09a6f3668a Jeff*0065 CALL CALC_WGHT2D(i,j,atm_oc_ind(j),atm_oc_wgt(j))
0066
0067 IF (atm_oc_wgt(j).LT.1. _d 0)
0068 & CALL CALC_WGHT2D(i, j, atm_oc_ind(j)+1,
0069 & 1. _d 0-atm_oc_wgt(j))
0070
f67c0bf3c1 Jeff*0071 fv_2D(i,j) = fv_toC
0072
09a6f3668a Jeff*0073
0074 qnet_atm(i,j)= qnet_atm(i,j) +
0075 & qneti_2D(i,j)*dtatmo*iceMask(i,j,1,1) +
0076 & qneto_2D(i,j)*dtatmo*(1. _d 0-iceMask(i,j,1,1))
0077 evap_atm(i,j)= evap_atm(i,j) +
0078 & evapi_2D(i,j)*dtatmo*iceMask(i,j,1,1) +
0079 & evapo_2D(i,j)*dtatmo*(1. _d 0-iceMask(i,j,1,1))
0080 precip_atm(i,j)= precip_atm(i,j) +
0081 & precipi_2D(i,j)*dtatmo*iceMask(i,j,1,1) +
0082 & precipo_2D(i,j)*dtatmo*(1. _d 0-iceMask(i,j,1,1))
0083 runoff_atm(i,j)= runoff_atm(i,j) +
0084 & runoff_2D(i,j)*dtatmo
0efd285817 Jeff*0085 ENDIF
09a6f3668a Jeff*0086
0087 ENDDO
0088 ENDDO
9274434acc Jean*0089
09a6f3668a Jeff*0090 RETURN
0091 END
0092
0093
0094
0095
0096 #include "ctrparam.h"
0097 #include "ATM2D_OPTIONS.h"
0098
0099
0100 SUBROUTINE CALC_WGHT2D( i, j, ind, wgt)
0101
0102
0103
0104
0105
0106
0107
0108 IMPLICIT NONE
0109
0110 #include "ATMSIZE.h"
0111 #include "SIZE.h"
0112 #include "EEPARAMS.h"
0113
0114
0115 #include "THSICE_VARS.h"
0116
0117
0118 #include "ATM2D_VARS.h"
0119
0120
0121
0122
0123
0124
0125 INTEGER i, j
9274434acc Jean*0126 INTEGER ind
09a6f3668a Jeff*0127 _RL wgt
0128
0129 precipo_2D(i,j)= precipo_2D(i,j) + atm_precip(ind)*wgt
0130 solarnet_ocn_2D(i,j)=solarnet_ocn_2D(i,j) + atm_solar_ocn(ind)*wgt
0131 slp_2D(i,j)= slp_2D(i,j) + atm_slp(ind)*wgt
0132 pCO2_2D(i,j)= pCO2_2D(i,j) + atm_pco2(ind)*wgt
0133 wspeed_2D(i,j)= wspeed_2D(i,j) + atm_windspeed(ind)*wgt
0134 fu_2D(i,j)= fu_2D(i,j) + atm_tauu(ind)*wgt
0135
0136 qneto_2D(i,j)= qneto_2D(i,j) + atm_qnet_ocn(ind)*wgt
0137 evapo_2D(i,j)= evapo_2D(i,j) + atm_evap_ocn(ind)*wgt
0138 IF (evapo_2D(i,j).GT.0. _d 0) THEN
0139 precipo_2D(i,j)= precipo_2D(i,j) - evapo_2D(i,j)
0140 evapo_2D(i,j)=0. _d 0
0141 ENDIF
0142
0143 IF (iceMask(i,j,1,1) .GT. 0. _d 0) THEN
0144 qneti_2D(i,j)= qneti_2D(i,j) + atm_qnet_ice(ind)*wgt
0145 precipi_2D(i,j)= precipi_2D(i,j) + atm_precip(ind)*wgt
0146 evapi_2D(i,j)= evapi_2D(i,j) + atm_evap_ice(ind)*wgt
0147 IF (evapi_2D(i,j).GT.0. _d 0) THEN
0148 precipi_2D(i,j)= precipi_2D(i,j) - evapi_2D(i,j)
0149 evapi_2D(i,j)=0. _d 0
0150 ENDIF
0151 dFdT_ice_2D(i,j)= dFdT_ice_2D(i,j) + atm_dFdT_ice(ind)*wgt
0152 Tair_2D(i,j)= Tair_2D(i,j) + atm_Tair(ind)*wgt
0153 solarinc_2D(i,j)= solarinc_2D(i,j) + atm_solarinc(ind)*wgt
0154 ENDIF
0155
0156 IF (useAltDeriv) THEN
0157 qneto_2D(i,j)= qneto_2D(i,j) + atm_dFdt_ocnq(ind)*
0efd285817 Jeff*0158 & (sstFromOcn(i,j)-ctocn(ind))*wgt
09a6f3668a Jeff*0159 evapo_2D(i,j)= evapo_2D(i,j) + atm_dLdt_ocnq(ind)*
0efd285817 Jeff*0160 & (sstFromOcn(i,j)-ctocn(ind))*wgt
09a6f3668a Jeff*0161 IF (iceMask(i,j,1,1) .GT. 0. _d 0) THEN
0162 qneti_2D(i,j)=qneti_2D(i,j)+atm_dFdt_iceq(ind)*
0efd285817 Jeff*0163 & (Tsrf(i,j,1,1)-ctice(ind))*wgt
09a6f3668a Jeff*0164 evapi_2D(i,j)=evapi_2D(i,j)+atm_dLdt_iceq(ind)*
0efd285817 Jeff*0165 & (Tsrf(i,j,1,1)-ctice(ind))*wgt
09a6f3668a Jeff*0166 ENDIF
0167 ELSE
0168 qneto_2D(i,j)= qneto_2D(i,j) + atm_dFdt_ocn(ind)*
0efd285817 Jeff*0169 & (sstFromOcn(i,j)-ctocn(ind))*wgt
09a6f3668a Jeff*0170 evapo_2D(i,j)= evapo_2D(i,j) + atm_dLdt_ocn(ind)*
0efd285817 Jeff*0171 & (sstFromOcn(i,j)-ctocn(ind))*wgt
09a6f3668a Jeff*0172 IF (iceMask(i,j,1,1) .GT. 0. _d 0) THEN
0173 qneti_2D(i,j)= qneti_2D(i,j) + atm_dFdt_ice(ind)*
0efd285817 Jeff*0174 & (Tsrf(i,j,1,1)-ctice(ind))*wgt
09a6f3668a Jeff*0175 evapi_2D(i,j)= evapi_2D(i,j)+atm_dLdt_ice(ind)*
0efd285817 Jeff*0176 & (Tsrf(i,j,1,1)-ctice(ind))*wgt
09a6f3668a Jeff*0177 ENDIF
0178 ENDIF
0179
0180
0181 RETURN
0182 END
0183
0184
0185
0186 #include "ctrparam.h"
0187 #include "ATM2D_OPTIONS.h"
0188
0189
0190 SUBROUTINE INIT_2DFLD( myThid)
0191
0192
0193
0194
0195 IMPLICIT NONE
0196
0197 #include "ATMSIZE.h"
0198 #include "SIZE.h"
0199 #include "EEPARAMS.h"
0200 #include "ATM2D_VARS.h"
0201
0202
0203
0204
0205 INTEGER myThid
0206
0207
0208 INTEGER i,j
0209
0210 DO i=1,sNx
0211 DO j=1,sNy
0212
0213 precipo_2D(i,j)= 0. _d 0
0214 precipi_2D(i,j)= 0. _d 0
0215 solarnet_ocn_2D(i,j)= 0. _d 0
0216 slp_2D(i,j)= 0. _d 0
0217 pCO2_2D(i,j)= 0. _d 0
0218 wspeed_2D(i,j)= 0. _d 0
0219 fu_2D(i,j)= 0. _d 0
0220 fv_2D(i,j)= 0. _d 0
0221 qneto_2D(i,j)= 0. _d 0
0222 evapo_2D(i,j)= 0. _d 0
0223 qneti_2D(i,j)= 0. _d 0
0224 evapi_2D(i,j)= 0. _d 0
0225 dFdT_ice_2D(i,j)= 0. _d 0
0226 Tair_2D(i,j)= 0. _d 0
0227 solarinc_2D(i,j)= 0. _d 0
0228 runoff_2D(i,j)= 0. _d 0
0229
0230 ENDDO
0231 ENDDO
0232
0233 RETURN
0234 END