/[MITgcm]/MITgcm_contrib/darwin2/pkg/monod/monod_init_vari.F
ViewVC logotype

Diff of /MITgcm_contrib/darwin2/pkg/monod/monod_init_vari.F

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

revision 1.9 by jahn, Fri May 3 19:24:02 2013 UTC revision 1.14 by jahn, Fri Dec 27 17:29:00 2013 UTC
# Line 41  c ANNA define params for WAVEBANDS Line 41  c ANNA define params for WAVEBANDS
41  #endif  #endif
42    
43    
44  C !INPUT PARAMETERS: ===================================================  C     !INPUT PARAMETERS: ===================================================
45  C  myThid               :: thread number  C     myThid               :: thread number
46        INTEGER myThid        INTEGER myThid
47    CEOP
48    
49  C     === Functions ===  C     !FUNCTIONS:
50        _RL DARWIN_RANDOM        _RL DARWIN_RANDOM
51        EXTERNAL DARWIN_RANDOM        EXTERNAL DARWIN_RANDOM
52    
53  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
 C     === Local variables ===  
54  C     msgBuf    - Informational/error meesage buffer  C     msgBuf    - Informational/error meesage buffer
55        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
56        INTEGER IniUnit1, IniUnit2        INTEGER IniUnit1, IniUnit2
57    
58          INTEGER bi, bj, k, i, j, iPAR        INTEGER bi, bj, k, i, j, iPAR
59    
60          INTEGER np        INTEGER np
61          INTEGER nz        INTEGER nz
62  c ANNA need nl for wavebands  c ANNA need nl for wavebands
63  #ifdef WAVEBANDS  #ifdef WAVEBANDS
64          integer ilam        INTEGER ilam
65          integer nl        INTEGER nl
66          _RL cu_area        _RL cu_area
67  #endif  #endif
68    
69  CEOP  C ----------------------------------------------------------------------
70    C Scalar bits first
71          _BEGIN_MASTER( myThid )
72    
73          WRITE(msgBuf,'(A)')          WRITE(msgBuf,'(A)')
74       &  '// ======================================================='       &  '// ======================================================='
# Line 80  CEOP Line 82  CEOP
82          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
83       &                      SQUEEZE_RIGHT, myThid )       &                      SQUEEZE_RIGHT, myThid )
84    
 c test....................  
 c       write(6,*)'testing in npzd2fe_init_vari '  
 c test....................  
       
   
85  c set up ecosystem coefficients  c set up ecosystem coefficients
86  c  c
87  c seed randomization  c seed randomization
         _BEGIN_MASTER( myThid )  
88    
89          CALL DARWIN_RANDOM_INIT(darwin_seed, myThid)          CALL DARWIN_RANDOM_INIT(darwin_seed, myThid)
90    
# Line 102  c initialize total number of functional Line 98  c initialize total number of functional
98  #endif  #endif
99           end do           end do
100    
         _END_MASTER( myThid )  
   
 c reduce amount of diaz  
 #ifdef ALLOW_DIAZ  
        IF (nIter0.EQ.PTRACERS_Iter0) THEN  
         do np = 1, npmax  
          if (diazotroph(np) .eq. 1. _d 0) then  
          DO bj = myByLo(myThid), myByHi(myThid)  
           DO bi = myBxLo(myThid), myBxHi(myThid)  
            DO j=1-Oly,sNy+Oly  
             DO i=1-Olx,sNx+Olx  
              DO k=1,nR  
                Ptracer(i,j,k,bi,bj,iPhy+np-1) =    
      &                Ptracer(i,j,k,bi,bj,iPhy+np-1)/10. _d 0  
              ENDDO  
             ENDDO  
            ENDDO  
           ENDDO  
          ENDDO  
          endif  
         enddo  
        ENDIF  
 #endif  
   
         _BEGIN_MASTER( myThid )  
   
101  c initialize zooplankton  c initialize zooplankton
102           call MONOD_GENERATE_ZOO(MyThid)           call MONOD_GENERATE_ZOO(MyThid)
103    
# Line 189  c  no temp/nutrient limitation Line 159  c  no temp/nutrient limitation
159  #endif  #endif
160  #endif  #endif
161  #endif  #endif
         _END_MASTER( myThid )  
   
 #ifdef DYNAMIC_CHL  
 C this initializes fields...  
         call MONOD_CHECK_CHL(myThid)  
 #endif  
162    
163           IF ( myProcId.EQ.0 .AND. myThid.EQ.1 ) THEN           IF ( myProcId.EQ.0 .AND. myThid.EQ.1 ) THEN
164  c write out initial phyto characteristics  c write out initial phyto characteristics
# Line 291  c ANNA outputs mQyield as 10^(4) mmol C Line 255  c ANNA outputs mQyield as 10^(4) mmol C
255           close(IniUnit1)           close(IniUnit1)
256   110     format(3f4.0,f6.2,4f4.0,f5.1,4f7.3,2e11.2,2f9.4,f6.1,2i5)   110     format(3f4.0,f6.2,4f4.0,f5.1,4f7.3,2e11.2,2f9.4,f6.1,2i5)
257   111     format(3f4.0,f6.2,4f4.0,f5.1,4f7.3,2f6.1,2f9.4,f6.1,2i5)   111     format(3f4.0,f6.2,4f4.0,f5.1,4f7.3,2f6.1,2f9.4,f6.1,2i5)
258    
259    #ifdef CHECK_CONS
260    coj find unused units for darwin_cons output
261            CALL MDSFINDUNIT( DAR_cons_unitP, mythid )
262            open(DAR_cons_unitP,file='darwin_cons_P.txt',status='unknown')
263            CALL MDSFINDUNIT( DAR_cons_unitN, mythid )
264            open(DAR_cons_unitN,file='darwin_cons_N.txt',status='unknown')
265            CALL MDSFINDUNIT( DAR_cons_unitF, mythid )
266            open(DAR_cons_unitF,file='darwin_cons_Fe.txt',status='unknown')
267            CALL MDSFINDUNIT( DAR_cons_unitS, mythid )
268            open(DAR_cons_unitS,file='darwin_cons_Si.txt',status='unknown')
269    #ifdef ALLOW_CARBON
270            CALL MDSFINDUNIT( DAR_cons_unitC, mythid )
271            open(DAR_cons_unitC,file='darwin_cons_C.txt',status='unknown')
272            CALL MDSFINDUNIT( DAR_cons_unitA, mythid )
273            open(DAR_cons_unitA,file='darwin_cons_A.txt',status='unknown')
274            CALL MDSFINDUNIT( DAR_cons_unitO, mythid )
275            open(DAR_cons_unitO,file='darwin_cons_O.txt',status='unknown')
276    #endif
277    #endif
278    
279  c       myProcId and myThid  c       myProcId and myThid
280          ENDIF          ENDIF
281    
282            WRITE(msgBuf,'(A)')
283         &  '// ======================================================='
284            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
285         &                      SQUEEZE_RIGHT, myThid )
286            WRITE(msgBuf,'(A)') '// Darwin init variables >>> END <<<'
287            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
288         &                      SQUEEZE_RIGHT, myThid )
289            WRITE(msgBuf,'(A)')
290         &  '// ======================================================='
291            CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
292         &                      SQUEEZE_RIGHT, myThid )
293    
294          _END_MASTER( myThid )
295          _BARRIER
296    
297    C ----------------------------------------------------------------------
298    C From here on we do actual 3d stuff appropriate for init_varia
299    
300    c reduce amount of diaz
301    #ifdef ALLOW_DIAZ
302           IF (nIter0.EQ.PTRACERS_Iter0) THEN
303            do np = 1, npmax
304             if (diazotroph(np) .eq. 1. _d 0) then
305             DO bj = myByLo(myThid), myByHi(myThid)
306              DO bi = myBxLo(myThid), myBxHi(myThid)
307               DO j=1-Oly,sNy+Oly
308                DO i=1-Olx,sNx+Olx
309                 DO k=1,nR
310                   Ptracer(i,j,k,bi,bj,iPhy+np-1) =
311         &                Ptracer(i,j,k,bi,bj,iPhy+np-1)/10. _d 0
312                 ENDDO
313                ENDDO
314               ENDDO
315              ENDDO
316             ENDDO
317             endif
318            enddo
319           ENDIF
320    #endif
321    
322    #ifdef GEIDER
323    C this initializes fields...
324            call MONOD_CHECK_CHL(myThid)
325    #endif
326    
327           CALL LEF_ZERO( fice,myThid )           CALL LEF_ZERO( fice,myThid )
328           CALL LEF_ZERO( inputFe,myThid )           CALL LEF_ZERO( inputFe,myThid )
329           CALL LEF_ZERO( sur_par,myThid )           CALL LEF_ZERO( sur_par,myThid )
# Line 325  c       myProcId and myThid Line 355  c       myProcId and myThid
355          ENDDO          ENDDO
356         ENDDO         ENDDO
357        ENDDO        ENDDO
358    #endif
359    
360        IF ( .NOT. ( startTime .EQ. baseTime .AND.  nIter0 .EQ. 0        IF ( .NOT. ( startTime .EQ. baseTime .AND.  nIter0 .EQ. 0
361       &     .AND. pickupSuff .EQ. ' ') ) THEN       &     .AND. pickupSuff .EQ. ' ') ) THEN
362  COJ should probably initialize from a file when nIter0 .EQ. 0  COJ should probably initialize from a file when nIter0 .EQ. 0
363          CALL DARWIN_READ_PICKUP( nIter0, myThid )          CALL DARWIN_READ_PICKUP( nIter0, myThid )
364        ENDIF        ENDIF
 #endif  
365  c  c
366  #ifdef ALLOW_TIMEAVE  #ifdef ALLOW_TIMEAVE
367  c set arrays to zero if first timestep  c set arrays to zero if first timestep
# Line 449  c ANNA end TAVE Line 480  c ANNA end TAVE
480  #endif  #endif
481  #endif  #endif
482  c         CALL TIMEAVE_RESET(SURave,   1,  bi, bj, myThid)  c         CALL TIMEAVE_RESET(SURave,   1,  bi, bj, myThid)
           WRITE(msgbuf,'(A)')  
      &      'QQ start timeave'  
           CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &                        SQUEEZE_RIGHT , mythid)  
483    
484            do k=1,Nr            DAR_timeAve(bi,bj)=0. _d 0
             DAR_TimeAve(bi,bj,k)=0. _d 0  
           enddo  
485           ENDDO           ENDDO
486          ENDDO          ENDDO
487  #endif /* ALLOW_TIMEAVE */  #endif /* ALLOW_TIMEAVE */
488    
 #ifdef CHECK_CONS  
        IF ( myProcId.EQ.0 .AND. myThid.EQ.1 ) THEN  
 coj find unused units for darwin_cons output  
         CALL MDSFINDUNIT( DAR_cons_unit1, mythid )  
         open(DAR_cons_unit1,file='darwin_cons_P.txt',status='unknown')  
         CALL MDSFINDUNIT( DAR_cons_unit2, mythid )  
         open(DAR_cons_unit2,file='darwin_cons_N.txt',status='unknown')  
         CALL MDSFINDUNIT( DAR_cons_unit3, mythid )  
         open(DAR_cons_unit3,file='darwin_cons_Fe.txt',status='unknown')  
         CALL MDSFINDUNIT( DAR_cons_unit4, mythid )  
         open(DAR_cons_unit4,file='darwin_cons_Si.txt',status='unknown')  
 #ifdef ALLOW_CARBON  
         CALL MDSFINDUNIT( DAR_cons_unit5, mythid )  
         open(DAR_cons_unit5,file='darwin_cons_C.txt',status='unknown')  
         CALL MDSFINDUNIT( DAR_cons_unit6, mythid )  
         open(DAR_cons_unit6,file='darwin_cons_A.txt',status='unknown')  
         CALL MDSFINDUNIT( DAR_cons_unit7, mythid )  
         open(DAR_cons_unit7,file='darwin_cons_O.txt',status='unknown')  
 #endif  
 c      myProcId and myThid  
        ENDIF  
 #endif  
   
 c test....................  
 c       write(6,*)'finishing darwin_init_vari '  
 c test....................  
         WRITE(msgBuf,'(A)')  
      &  '// ======================================================='  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &                      SQUEEZE_RIGHT, myThid )  
         WRITE(msgBuf,'(A)') '// Darwin init variables >>> END <<<'  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &                      SQUEEZE_RIGHT, myThid )  
         WRITE(msgBuf,'(A)')  
      &  '// ======================================================='  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &                      SQUEEZE_RIGHT, myThid )  
   
489    
490           RETURN           RETURN
491           END           END

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22