Back to home page

darwin3

 
 

    


File indexing completed on 2025-09-13 12:07:55 UTC

view on githubraw file Latest commit 13ce79fe on 2025-08-04 21:05:34 UTC
24462d2fa8 Patr*0001 #include "PROFILES_OPTIONS.h"
36c7a91797 Gael*0002 #ifdef ALLOW_CTRL
                0003 # include "CTRL_OPTIONS.h"
                0004 #endif
6a770e0a24 Patr*0005 
13ce79fe94 Ivan*0006 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0007 CBOP
                0008 C !ROUTINE: PROFILES_INLOOP
6a770e0a24 Patr*0009 
13ce79fe94 Ivan*0010 C !INTERFACE:
                0011       SUBROUTINE PROFILES_INLOOP( myTime, myThid )
6a770e0a24 Patr*0012 
13ce79fe94 Ivan*0013 C     !DESCRIPTION:
                0014 C     Computes and writes model counterparts
                0015 C     for netcdf profiles data
                0016 C     Started: Gael Forget 15-March-2006
6a770e0a24 Patr*0017 
13ce79fe94 Ivan*0018 C     !USES:
                0019       IMPLICIT NONE
                0020 C     == Global variables ===
6a770e0a24 Patr*0021 #include "EEPARAMS.h"
                0022 #include "SIZE.h"
                0023 #include "GRID.h"
                0024 #include "DYNVARS.h"
                0025 #include "PARAMS.h"
24462d2fa8 Patr*0026 #ifdef ALLOW_CAL
13ce79fe94 Ivan*0027 # include "cal.h"
24462d2fa8 Patr*0028 #endif
                0029 #ifdef ALLOW_CTRL
13ce79fe94 Ivan*0030 # include "OPTIMCYCLE.h"
24462d2fa8 Patr*0031 #endif
                0032 #ifdef ALLOW_PROFILES
6328b73337 Gael*0033 # include "PROFILES_SIZE.h"
6e4c90fea3 Patr*0034 # include "profiles.h"
                0035 # include "netcdf.inc"
                0036 #endif
6a770e0a24 Patr*0037 
13ce79fe94 Ivan*0038 C     !INPUT PARAMETERS:
                0039 C     myTime: time counter for this thread
                0040 C     myThid: my thread ID number
                0041       _RL     myTime
                0042       INTEGER myThid
                0043 C     !OUTPUT PARAMETERS:
                0044 CEOP
6e4c90fea3 Patr*0045 
13ce79fe94 Ivan*0046 C     !LOCAL VARIABLES:
24462d2fa8 Patr*0047 #ifdef ALLOW_PROFILES
13ce79fe94 Ivan*0048       INTEGER kLev, iq
                0049       INTEGER bi,bj,prof_num, num_file, num_var
f0e4bffe35 Gael*0050       _RL prof_traj1D(NLEVELMAX),prof_mask1D(NLEVELMAX)
13ce79fe94 Ivan*0051       INTEGER prof_i1D(NUM_INTERP_POINTS),prof_j1D(NUM_INTERP_POINTS)
ba63501b4c Gael*0052       _RL prof_w1D(NUM_INTERP_POINTS)
13ce79fe94 Ivan*0053 # ifndef ALLOW_CTRL
                0054       INTEGER optimcycle
                0055 # endif
                0056 # ifndef ALLOW_ECCO
                0057       INTEGER i,j,k
                0058 # endif
                0059 
                0060 # ifndef ALLOW_CTRL
24462d2fa8 Patr*0061       optimcycle = 0
13ce79fe94 Ivan*0062 # endif
                0063 
                0064 # ifndef ALLOW_ECCO
                0065       DO bj = myByLo(myThid), myByHi(myThid)
                0066         DO bi = myBxLo(myThid), myBxHi(myThid)
                0067           DO k = 1, Nr
                0068             DO j = 1, sNy
                0069               DO i =  1, sNx
da0e0765ef An T*0070                 m_UE(i,j,k,bi,bj)=0. _d 0
                0071                 m_VN(i,j,k,bi,bj)=0. _d 0
13ce79fe94 Ivan*0072               ENDDO
                0073             ENDDO
                0074           ENDDO
                0075         ENDDO
                0076       ENDDO
da0e0765ef An T*0077 
                0078       CALL ROTATE_UV2EN_RL(
13ce79fe94 Ivan*0079      U     uVel, vVel, m_UE, m_VN,
                0080      I     .TRUE., .TRUE., .FALSE., Nr, myThid )
                0081 # endif /* not ALLOW_ECCO */
                0082 
                0083       _BEGIN_MASTER( myThid )
                0084 
                0085       DO bj = 1, nSy
                0086         DO bi = 1, nSx
                0087           DO num_file = 1, NFILESPROFMAX
                0088             DO prof_num = 1, NOBSGLOB
                0089               IF (prof_num.LE.ProfNo(num_file,bi,bj)) THEN
                0090                 IF (
                0091      &           (prof_time(num_file,prof_num,bi,bj).GE.myTime) .AND.
                0092      &           (prof_time(num_file,prof_num,bi,bj).LT.
                0093      &            (myTime+deltaTClock)) ) THEN
                0094                   DO iq = 1, NUM_INTERP_POINTS
                0095                     prof_i1D(iq) =
                0096      &               prof_interp_i(num_file,prof_num,iq,bi,bj)
                0097                     prof_j1D(iq) =
                0098      &               prof_interp_j(num_file,prof_num,iq,bi,bj)
                0099                     prof_w1D(iq) =
                0100      &               prof_interp_weights(num_file,prof_num,iq,bi,bj)
                0101 
                0102                   ENDDO
                0103 
                0104                   DO num_var = 1, NVARMAX
                0105                     DO kLev = 1, NLEVELMAX
                0106                       prof_traj1D(kLev) = 0
                0107                       prof_mask1D(kLev) = 0
                0108                     ENDDO
                0109 
                0110                     IF (vec_quantities(num_file,num_var,bi,bj)) THEN
                0111                       CALL PROFILES_INTERP( prof_traj1D,
                0112      &                     prof_i1D,prof_j1D,prof_w1D,
                0113      &                     prof_namesmod(num_file,num_var),
                0114      &                     prof_itracer(num_file,num_var),
                0115      &                     num_file,myTime,bi,bj,myThid )
                0116 
                0117                       DO kLev = 1, NLEVELMAX
                0118                         prof_traj1D(kLev) = prof_traj1D(kLev)*
fd8f717f84 Gael*0119      &                   prof_facmod(num_file,num_var)
13ce79fe94 Ivan*0120                       ENDDO
6cc0cb518f Gael*0121 
13ce79fe94 Ivan*0122                       CALL ACTIVE_WRITE_PROFILE( num_file,
                0123      &                     ProfDepthNo(num_file,bi,bj),prof_traj1D,
                0124      &                     num_var,prof_num,optimcycle,bi,bj,myThid,
                0125      &                     profiles_dummy(num_file,num_var,bi,bj) )
6a770e0a24 Patr*0126 
13ce79fe94 Ivan*0127                     ENDIF !IF (vec_quantities(num_file,num_var,bi,bj)
                0128 
                0129                   ENDDO !DO num_var
                0130 
                0131                 ENDIF !IF ((prof_time
                0132               ENDIF !IF (ProfNo(num_file,bi,bj).NE.0)
                0133             ENDDO !DO prof_num
                0134           ENDDO !DO num_file
                0135         ENDDO !DO bi
                0136       ENDDO !DO bj
                0137 
                0138       _END_MASTER( myThid )
6a770e0a24 Patr*0139 
13ce79fe94 Ivan*0140 #endif /* ALLOW_PROFILES */
6a770e0a24 Patr*0141 
13ce79fe94 Ivan*0142       RETURN
                0143       END