Back to home page

MITgcm

 
 

    


File indexing completed on 2025-08-05 05:09:15 UTC

view on githubraw file Latest commit 13ce79fe on 2025-08-04 21:05:34 UTC
24462d2fa8 Patr*0001 #include "PROFILES_OPTIONS.h"
6e4c90fea3 Patr*0002 
13ce79fe94 Ivan*0003 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0004 CBOP
                0005 C !ROUTINE: PROFILES_INIT_VARIA
                0006 
                0007 C !INTERFACE:
                0008       SUBROUTINE PROFILES_INIT_VARIA( myThid )
                0009 
                0010 C     !DESCRIPTION:
                0011 C     Initialise the variable cost function part.
                0012 C     Started: Christian Eckert eckert@mit.edu 30-Jun-1999
                0013 C     Changed: Christian Eckert eckert@mit.edu 18-Apr-2000
                0014 C              - Restructured the code in order to create a package
                0015 C                for the MITgcmUV.
                0016 C              heimbach@mit.edu 05-Nov-2003
                0017 C              - Now ecco part of cost
                0018 
                0019 C     !USES:
                0020       IMPLICIT NONE
                0021 C     == Global variables ===
6e4c90fea3 Patr*0022 #include "EEPARAMS.h"
                0023 #include "SIZE.h"
                0024 #include "GRID.h"
                0025 
24462d2fa8 Patr*0026 #ifdef ALLOW_PROFILES
6328b73337 Gael*0027 # include "PROFILES_SIZE.h"
                0028 # include "profiles.h"
6e4c90fea3 Patr*0029 #endif
                0030 
13ce79fe94 Ivan*0031 #ifdef ALLOW_GRDCHK
                0032 # include "netcdf.inc"
                0033 #endif
                0034 
                0035 C     !INPUT/OUTPUT PARAMETERS:
                0036 C     myThid: my thread ID number
                0037       INTEGER myThid
                0038 CEOP
                0039 
                0040 C     !LOCAL VARIABLES:
                0041       INTEGER bi,bj
                0042       INTEGER num_file,num_var
                0043 #ifdef ALLOW_GRDCHK
                0044       INTEGER err
                0045 #endif /* ALLOW_GRDCHK */
                0046 
                0047 C Initialize tiled cost function contributions.
                0048       DO bj = myByLo(myThid), myByHi(myThid)
                0049         DO bi = myBxLo(myThid), myBxHi(myThid)
                0050           DO num_file = 1, NFILESPROFMAX
                0051             DO num_var = 1, NVARMAX
                0052               objf_profiles(num_file,num_var,bi,bj) = 0. _d 0
                0053               num_profiles(num_file,num_var,bi,bj)  = 0. _d 0
                0054               profiles_dummy(num_file,num_var,bi,bj) = 0. _d 0
                0055             ENDDO !DO num_var
                0056           ENDDO !DO num_file
                0057 
                0058           DO num_var = 1,NVARMAX
                0059             objf_profiles_mean(num_var,bi,bj) = 0. _d 0
                0060             num_profiles_mean(num_var,bi,bj) = 0. _d 0
                0061           ENDDO !DO num_var
                0062 
                0063 #ifdef ALLOW_GRDCHK
                0064           IF (profilesDoNcOutput) THEN
                0065             DO num_file = 1, NFILESPROFMAX
                0066               IF (ProfNo(num_file,bi,bj).GT.0) THEN
                0067 C Write data from buffer to .nc file
                0068                 err = NF_SYNC( fidforward(num_file,bi,bj) )
                0069                 CALL PROFILES_NF_ERROR(
                0070      &               'INIT_VARIA: NF_SYNC fidforward',
                0071      &               err,bi,bj,myThid )
                0072 
                0073 # ifdef ALLOW_TANGENTLINEAR_RUN
                0074                 IF (TANGENT_SIMULATION) THEN
                0075                   err = NF_SYNC( fidtangent(num_file,bi,bj) )
                0076                   CALL PROFILES_NF_ERROR(
                0077      &                 'INIT_VARIA: NF_SYNC fidtangent',
                0078      &                 err,bi,bj,myThid )
                0079                 ENDIF
                0080 # endif /* ALLOW_TANGENTLINEAR_RUN */
                0081 
                0082               ENDIF !IF (ProfNo
                0083             ENDDO !DO num_file
                0084           ENDIF !IF (profilesDoNcOutput)
                0085 #endif /* ALLOW_GRDCHK */
                0086 
                0087         ENDDO !DO bi
                0088       ENDDO !DO bj
6e4c90fea3 Patr*0089 
                0090       _BARRIER
                0091 
13ce79fe94 Ivan*0092       RETURN
                0093       END