/[MITgcm]/MITgcm/pkg/exf/exf_getffields.F
ViewVC logotype

Diff of /MITgcm/pkg/exf/exf_getffields.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.67 by gforget, Fri Jan 20 20:45:58 2017 UTC revision 1.68 by jmc, Fri Jan 27 17:12:08 2017 UTC
# Line 74  C--   read forcing fields from files and Line 74  C--   read forcing fields from files and
74    
75  C     Zonal and meridional wind stress.  C     Zonal and meridional wind stress.
76        IF ( .NOT.useAtmWind ) THEN        IF ( .NOT.useAtmWind ) THEN
77        CALL EXF_SET_UV(         CALL EXF_SET_UV(
78       I     ustressfile, ustressstartdate, ustressperiod,       I     ustressfile, ustressstartdate, ustressperiod,
79       I     exf_inscal_ustress,       I     exf_inscal_ustress,
80       I     ustress_exfremo_intercept, ustress_exfremo_slope,       I     ustress_exfremo_intercept, ustress_exfremo_slope,
# Line 119  C--   wind speed Line 119  C--   wind speed
119    
120  C     Zonal and meridional wind.  C     Zonal and meridional wind.
121        IF ( useAtmWind ) THEN        IF ( useAtmWind ) THEN
122        CALL EXF_SET_UV(         CALL EXF_SET_UV(
123       I     uwindfile, uwindstartdate, uwindperiod,       I     uwindfile, uwindstartdate, uwindperiod,
124       I     exf_inscal_uwind,       I     exf_inscal_uwind,
125       I     uwind_exfremo_intercept, uwind_exfremo_slope,       I     uwind_exfremo_intercept, uwind_exfremo_slope,
# Line 136  C     Zonal and meridional wind. Line 136  C     Zonal and meridional wind.
136  #endif /* USE_EXF_INTERPOLATION */  #endif /* USE_EXF_INTERPOLATION */
137       I     myTime, myIter, myThid )       I     myTime, myIter, myThid )
138    
139        if (useRelativeWind) then         IF (useRelativeWind) THEN
140  C     Subtract UVEL and VVEL from UWIND and VWIND.  C     Subtract UVEL and VVEL from UWIND and VWIND.
141         DO bj = myByLo(myThid),myByHi(myThid)          DO bj = myByLo(myThid),myByHi(myThid)
142          DO bi = myBxLo(myThid),mybxhi(myThid)           DO bi = myBxLo(myThid),mybxhi(myThid)
143           DO j = 1,sNy            DO j = 1,sNy
144            DO i = 1,sNx             DO i = 1,sNx
145             uwind(i,j,bi,bj) = uwind(i,j,bi,bj) - 0.5 _d 0 *              uwind(i,j,bi,bj) = uwind(i,j,bi,bj) - 0.5 _d 0
146       &          (uVel(i,j,1,bi,bj)+uVel(i+1,j,1,bi,bj))       &         * (uVel(i,j,1,bi,bj)+uVel(i+1,j,1,bi,bj))
147             vwind(i,j,bi,bj) = vwind(i,j,bi,bj) - 0.5 _d 0 *              vwind(i,j,bi,bj) = vwind(i,j,bi,bj) - 0.5 _d 0
148       &          (vVel(i,j,1,bi,bj)+vVel(i,j+1,1,bi,bj))       &         * (vVel(i,j,1,bi,bj)+vVel(i,j+1,1,bi,bj))
149               ENDDO
150            ENDDO            ENDDO
151           ENDDO           ENDDO
152          ENDDO          ENDDO
153         ENDDO         ENDIF
       endif  
154    
155        ELSE        ELSE
156         DO bj = myByLo(myThid),myByHi(myThid)         DO bj = myByLo(myThid),myByHi(myThid)
# Line 224  C     Atmospheric humidity. Line 224  C     Atmospheric humidity.
224  #endif  #endif
225       &     myTime, myIter, myThid )       &     myTime, myIter, myThid )
226    
227    # ifdef ALLOW_READ_TURBFLUXES
228    
229    C     Sensible Heat flux
230          CALL EXF_SET_GEN(
231         &     hs_file, hs_startdate, hs_period,
232         &     exf_inscal_hs,
233         &     hs_exfremo_intercept, hs_exfremo_slope,
234         &     hs, hs0, hs1, hs_mask,
235    #  ifdef USE_EXF_INTERPOLATION
236         &     hs_lon0, hs_lon_inc, hs_lat0, hs_lat_inc,
237         &     hs_nlon, hs_nlat, xC, yC, hs_interpMethod,
238    #  endif
239         &     myTime, myIter, myThid )
240    
241    C     Latent Heat flux
242          CALL EXF_SET_GEN(
243         &     hl_file, hl_startdate, hl_period,
244         &     exf_inscal_hl,
245         &     hl_exfremo_intercept, hl_exfremo_slope,
246         &     hl, hl0, hl1, hl_mask,
247    #  ifdef USE_EXF_INTERPOLATION
248         &     hl_lon0, hl_lon_inc, hl_lat0, hl_lat_inc,
249         &     hl_nlon, hl_nlat, xC, yC, hl_interpMethod,
250    #  endif
251         &     myTime, myIter, myThid )
252    
253    # endif /* ALLOW_READ_TURBFLUXES */
254    
255  C     Net long wave radiative flux.  C     Net long wave radiative flux.
256        CALL EXF_SET_GEN(        CALL EXF_SET_GEN(
257       &     lwfluxfile, lwfluxstartdate, lwfluxperiod,       &     lwfluxfile, lwfluxstartdate, lwfluxperiod,
# Line 303  C     Evaporation Line 331  C     Evaporation
331       &     evap_nlon, evap_nlat, xC, yC, evap_interpMethod,       &     evap_nlon, evap_nlat, xC, yC, evap_interpMethod,
332  #endif  #endif
333       &     myTime, myIter, myThid )       &     myTime, myIter, myThid )
334  #endif  #endif /* EXF_READ_EVAP */
335    
336  #ifdef ALLOW_DOWNWARD_RADIATION  #ifdef ALLOW_DOWNWARD_RADIATION
337    
# Line 331  C     Downward longwave radiation. Line 359  C     Downward longwave radiation.
359  #endif  #endif
360       &     myTime, myIter, myThid )       &     myTime, myIter, myThid )
361    
362  #endif  #endif /* ALLOW_DOWNWARD_RADIATION */
363    
364  #ifdef ATMOSPHERIC_LOADING  #ifdef ATMOSPHERIC_LOADING
365  C     Atmos. pressure forcing  C     Atmos. pressure forcing
# Line 407  C     Salt flux Line 435  C     Salt flux
435  #endif  #endif
436    
437  #ifdef ALLOW_ROTATE_UV_CONTROLS  #ifdef ALLOW_ROTATE_UV_CONTROLS
438        if ( useCTRL ) then        IF ( useCTRL ) THEN
439          DO bj = myByLo(myThid),myByHi(myThid)          DO bj = myByLo(myThid),myByHi(myThid)
440           DO bi = myBxLo(myThid),mybxhi(myThid)           DO bi = myBxLo(myThid),mybxhi(myThid)
441            DO j = 1-OLy,sNy+OLy            DO j = 1-OLy,sNy+OLy
# Line 420  C     Salt flux Line 448  C     Salt flux
448            ENDDO            ENDDO
449           ENDDO           ENDDO
450          ENDDO          ENDDO
451        endif        ENDIF
452  #endif  #endif
453    
454  # if (!defined (ALLOW_ECCO) || defined (ECCO_CTRL_DEPRECATED))  # if (!defined (ALLOW_ECCO) || defined (ECCO_CTRL_DEPRECATED))
455    
456  C-- Control variables for atmos. state  C-- Control variables for atmos. state
457  #ifdef ALLOW_CTRL  #ifdef ALLOW_CTRL
458        if (.NOT.ctrlUseGen) then        IF (.NOT.ctrlUseGen) THEN
459    
460  #ifdef ALLOW_ATEMP_CONTROL  #ifdef ALLOW_ATEMP_CONTROL
461        CALL CTRL_GET_GEN (        CALL CTRL_GET_GEN (
# Line 469  C-- Control variables for atmos. state Line 497  C-- Control variables for atmos. state
497       &     wlwdown, myTime, myIter, myThid )       &     wlwdown, myTime, myIter, myThid )
498  #endif  #endif
499    
500        endif !if (.NOT.ctrlUseGen) then        ENDIF !if (.NOT.ctrlUseGen) then
501    
502  #ifdef ALLOW_SWFLUX_CONTROL  #ifdef ALLOW_SWFLUX_CONTROL
503        CALL CTRL_GET_GEN (        CALL CTRL_GET_GEN (
# Line 611  cdm #endif Line 639  cdm #endif
639  #endif /* undef ALLOW_ECCO) || def ECCO_CTRL_DEPRECATED */  #endif /* undef ALLOW_ECCO) || def ECCO_CTRL_DEPRECATED */
640    
641  #if (defined (ALLOW_CTRL) && defined (ALLOW_GENTIM2D_CONTROL))  #if (defined (ALLOW_CTRL) && defined (ALLOW_GENTIM2D_CONTROL))
642        if ( useCTRL.AND.ctrlUseGen ) then        IF ( useCTRL.AND.ctrlUseGen ) THEN
643        DO bj = myByLo(myThid),myByHi(myThid)         DO bj = myByLo(myThid),myByHi(myThid)
644         DO bi = myBxLo(myThid),mybxhi(myThid)         DO bi = myBxLo(myThid),mybxhi(myThid)
645          DO j = 1,sNy          DO j = 1,sNy
646           DO i = 1,sNx           DO i = 1,sNx
647             do iarr = 1, maxCtrlTim2D            DO iarr = 1, maxCtrlTim2D
648  #ifdef ALLOW_ATM_TEMP  #ifdef ALLOW_ATM_TEMP
649             if (xx_gentim2d_file(iarr)(1:8).EQ.'xx_atemp')             IF (xx_gentim2d_file(iarr)(1:8).EQ.'xx_atemp')
650       &       atemp(i,j,bi,bj)=atemp(i,j,bi,bj)+       &       atemp(i,j,bi,bj)=atemp(i,j,bi,bj)+
651       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
652             if (xx_gentim2d_file(iarr)(1:6).EQ.'xx_aqh')             IF (xx_gentim2d_file(iarr)(1:6).EQ.'xx_aqh')
653       &       aqh(i,j,bi,bj)=aqh(i,j,bi,bj)+       &       aqh(i,j,bi,bj)=aqh(i,j,bi,bj)+
654       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
655             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_precip')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_precip')
656       &       precip(i,j,bi,bj)=precip(i,j,bi,bj)+       &       precip(i,j,bi,bj)=precip(i,j,bi,bj)+
657       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
658             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_lwflux')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_lwflux')
659       &       lwflux(i,j,bi,bj)=lwflux(i,j,bi,bj)+       &       lwflux(i,j,bi,bj)=lwflux(i,j,bi,bj)+
660       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
661  #endif  #endif
662  #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)  #if defined(ALLOW_ATM_TEMP) || defined(SHORTWAVE_HEATING)
663             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_swflux')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_swflux')
664       &       swflux(i,j,bi,bj)=swflux(i,j,bi,bj)+       &       swflux(i,j,bi,bj)=swflux(i,j,bi,bj)+
665       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
666  #endif  #endif
667  #ifdef ALLOW_DOWNWARD_RADIATION  #ifdef ALLOW_DOWNWARD_RADIATION
668             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_swdown')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_swdown')
669       &       swdown(i,j,bi,bj)=swdown(i,j,bi,bj)+       &       swdown(i,j,bi,bj)=swdown(i,j,bi,bj)+
670       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
671             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_lwdown')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_lwdown')
672       &       lwdown(i,j,bi,bj)=lwdown(i,j,bi,bj)+       &       lwdown(i,j,bi,bj)=lwdown(i,j,bi,bj)+
673       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
674  #endif  #endif
675  #ifdef ALLOW_RUNOFF  #ifdef ALLOW_RUNOFF
676             if (xx_gentim2d_file(iarr)(1:9).EQ.'xx_runoff')             IF (xx_gentim2d_file(iarr)(1:9).EQ.'xx_runoff')
677       &       runoff(i,j,bi,bj)=runoff(i,j,bi,bj)+       &       runoff(i,j,bi,bj)=runoff(i,j,bi,bj)+
678       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
679  #endif  #endif
680  #ifdef EXF_READ_EVAP  #ifdef EXF_READ_EVAP
681             if (xx_gentim2d_file(iarr)(1:7).EQ.'xx_evap')             IF (xx_gentim2d_file(iarr)(1:7).EQ.'xx_evap')
682       &       evap(i,j,bi,bj)=evap(i,j,bi,bj)+       &       evap(i,j,bi,bj)=evap(i,j,bi,bj)+
683       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
684  #endif  #endif
685  #ifdef ATMOSPHERIC_LOADING  #ifdef ATMOSPHERIC_LOADING
686             if (xx_gentim2d_file(iarr)(1:12).EQ.'xx_apressure')             IF (xx_gentim2d_file(iarr)(1:12).EQ.'xx_apressure')
687       &       apressure(i,j,bi,bj)=apressure(i,j,bi,bj)+       &       apressure(i,j,bi,bj)=apressure(i,j,bi,bj)+
688       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
689  #endif  #endif
690  #ifdef EXF_SEAICE_FRACTION  #ifdef EXF_SEAICE_FRACTION
691             if (xx_gentim2d_file(iarr)(1:11).EQ.'xx_areamask')             IF (xx_gentim2d_file(iarr)(1:11).EQ.'xx_areamask')
692       &       areamask(i,j,bi,bj)=areamask(i,j,bi,bj)+       &       areamask(i,j,bi,bj)=areamask(i,j,bi,bj)+
693       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
694  #endif  #endif
695  #ifndef ALLOW_ROTATE_UV_CONTROLS  #ifndef ALLOW_ROTATE_UV_CONTROLS
696             if (xx_gentim2d_file(iarr)(1:8).EQ.'xx_uwind')             IF (xx_gentim2d_file(iarr)(1:8).EQ.'xx_uwind')
697       &       uwind(i,j,bi,bj)=uwind(i,j,bi,bj)+       &       uwind(i,j,bi,bj)=uwind(i,j,bi,bj)+
698       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
699             if (xx_gentim2d_file(iarr)(1:8).EQ.'xx_vwind')             IF (xx_gentim2d_file(iarr)(1:8).EQ.'xx_vwind')
700       &       vwind(i,j,bi,bj)=vwind(i,j,bi,bj)+       &       vwind(i,j,bi,bj)=vwind(i,j,bi,bj)+
701       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
702  #else  #else
703             if (xx_gentim2d_file(iarr)(1:8).EQ.'xx_uwind')             IF (xx_gentim2d_file(iarr)(1:8).EQ.'xx_uwind')
704       &       tmpUE(i,j,bi,bj)=tmpUE(i,j,bi,bj)+       &       tmpUE(i,j,bi,bj)=tmpUE(i,j,bi,bj)+
705       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
706             if (xx_gentim2d_file(iarr)(1:8).EQ.'xx_vwind')             IF (xx_gentim2d_file(iarr)(1:8).EQ.'xx_vwind')
707       &       tmpVN(i,j,bi,bj)=tmpVN(i,j,bi,bj)+       &       tmpVN(i,j,bi,bj)=tmpVN(i,j,bi,bj)+
708       &                         xx_gentim2d(i,j,bi,bj,iarr)       &                         xx_gentim2d(i,j,bi,bj,iarr)
709  #endif  #endif
710             enddo            ENDDO
711           ENDDO           ENDDO
712          ENDDO          ENDDO
713         ENDDO         ENDDO
714        ENDDO         ENDDO
715  #ifdef ALLOW_ROTATE_UV_CONTROLS  #ifdef ALLOW_ROTATE_UV_CONTROLS
716        CALL ROTATE_UV2EN_RL(tmpUX,tmpVY,tmpUE,tmpVN,         CALL ROTATE_UV2EN_RL(tmpUX,tmpVY,tmpUE,tmpVN,
717       &     .FALSE.,.FALSE.,.TRUE.,1,myThid)       &      .FALSE.,.FALSE.,.TRUE.,1,myThid)
718    
719         DO bj = myByLo(myThid),myByHi(myThid)         DO bj = myByLo(myThid),myByHi(myThid)
720           DO bi = myBxLo(myThid),mybxhi(myThid)           DO bi = myBxLo(myThid),mybxhi(myThid)
# Line 700  cdm #endif Line 728  cdm #endif
728         ENDDO         ENDDO
729  #endif /* ALLOW_ROTATE_UV_CONTROLS */  #endif /* ALLOW_ROTATE_UV_CONTROLS */
730    
731        endif !if (ctrlUseGen) then        ENDIF !if (ctrlUseGen) then
732  #endif  #endif
733    
734        RETURN        RETURN

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

  ViewVC Help
Powered by ViewVC 1.1.22