/[MITgcm]/MITgcm_contrib/nesting_sannino/nest_driver/main.F
ViewVC logotype

Diff of /MITgcm_contrib/nesting_sannino/nest_driver/main.F

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

revision 1.1 by jmc, Sun Nov 28 03:27:56 2010 UTC revision 1.2 by jmc, Mon Nov 29 14:24:14 2010 UTC
# Line 249  C-    log-file IO-unit and name: STDlog. Line 249  C-    log-file IO-unit and name: STDlog.
249        PARAMETER ( iUnit = 35 )        PARAMETER ( iUnit = 35 )
250        CHARACTER*11 fNam        CHARACTER*11 fNam
251        INTEGER mLoop        INTEGER mLoop
252          INTEGER nNestSteps, nNestStepsP, nNestStepsC
253  C----------------------------------------------------  C----------------------------------------------------
254  C     MPI starts here  C     MPI starts here
255  C----------------------------------------------------  C----------------------------------------------------
# Line 975  C- WesternB side Line 976  C- WesternB side
976  C---------------------------------------------------------  C---------------------------------------------------------
977        ONOFF=0        ONOFF=0
978        endif        endif
979    C---------------------------------------------------------
980    C     Check parameter consistency across components:
981    C     If inconsistent, send error code (-1) to every body and stop.
982    C-    For now, just check number of nesting-steps between components
983    C---------------------------------------------------------
984          IF ( rank.EQ.0 ) THEN
985    C-    Receive what the parent expects in term of nesting-exchanges Nb
986            CALL MPI_RECV( nNestStepsP, 1, MPI_INTEGER,
987         &                 MSTR_PRNT(NST_LEV), 3000,
988         &                 MPI_Comm_World, status, ierr )
989    C-    Receive what the child expects in term of nesting-exchanges Nb
990            CALL MPI_RECV( nNestStepsC, 1, MPI_INTEGER,
991         &                 MSTR_CHLD(NST_LEV), 3000,
992         &                 MPI_Comm_World, status, ierr )
993            IF ( nNestStepsP .EQ. nNestStepsC ) THEN
994              nNestSteps = nNestStepsP
995            ELSE
996              WRITE(iUnit,'(A,I8)') ' ===== nNestStepsP =', nNestStepsP
997              WRITE(iUnit,'(A,I8)') ' ===== nNestStepsC =', nNestStepsC
998              nNestSteps = -1
999            ENDIF
1000          ENDIF
1001    c     CALL MPI_BCAST( nNestSteps, 1, MPI_INTEGER,
1002    c    &                0, NEST_COMM, ierr )
1003    C     Note: above is redundant with following call
1004    
1005    C-    Broadcast error code (-1) from World-Master to every one in World
1006    C     Note: better than from: MSTR_DRV(NST_LEV) since, to stop cleanly
1007    C           with every one calling MPI_FINALIZE & stopping,
1008    C           error needs to be sent to everybody.
1009          CALL MPI_BCAST( nNestSteps, 1, MPI_INTEGER,
1010         &                0, MPI_Comm_World, ierr )
1011          WRITE(iUnit,'(A,I8)') ' - - - nNestSteps  =', nNestSteps
1012  C--------------------------------------------------------  C--------------------------------------------------------
1013  C     BEGIN MAIN LOOP  C     BEGIN MAIN LOOP
1014  C--------------------------------------------------------  C--------------------------------------------------------
1015        DO        DO mLoop=1,nNestSteps
1016          mLoop = mLoop + 1          WRITE(iUnit,'(A,I8)') '== Main Loop , iter=', mLoop
 c     DO mLoop=1,24  
         WRITE(iUnit,'(A,I6)') '== Main Loop , iter=', mLoop  
1017          if(rank.eq.0) then          if(rank.eq.0) then
1018  C--------------------------------------------------------  C--------------------------------------------------------
1019  C     (1) READ FROM PARENT MODEL  C     (1) READ FROM PARENT MODEL
# Line 1314  C--------------------------------------- Line 1346  C---------------------------------------
1346            ICONT=1            ICONT=1
1347    
1348            DO WHILE(ICONT.le.nSxC*nSyC)            DO WHILE(ICONT.le.nSxC*nSyC)
1349             write(iUnit,*)  c          write(iUnit,*)
1350       &     'CALL MPI_RECV 3-D var from CHILD, index3F=', index3F  c    &     'CALL MPI_RECV 3-D var from CHILD, index3F=', index3F
1351             from= MPI_ANY_SOURCE             from= MPI_ANY_SOURCE
1352             CALL MPI_RECV (globalC3D_a,index3F, MPI_REAL8,             CALL MPI_RECV (globalC3D_a,index3F, MPI_REAL8,
1353       &          from, 3000, MPI_COMM_World, status,ierr)       &          from, 3000, MPI_COMM_World, status,ierr)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22