SUBROUTINE THE_MODEL_MAIN C /==========================================================\ C | SUBROUTINE THE_MODEL_MAIN | C | o Master controlling routine for model using the MITgcm | C | UV parallel wrapper. | C |==========================================================| C | THE_MODEL_MAIN is invoked by the MITgcm UV parallel | C | wrapper with a single integer argument "myThid". This | C | variable identifies the thread number of an instance of | C | THE_MODEL_MAIN. Each instance of THE_MODEL_MAIN works | C | on a particular region of the models domain and | C | synchronises with other instances as necessary. The | C | routine has to "understand" the MITgcm parallel | C | environment and the numerical algorithm. Editing this | C | routine is best done with some knowledge of both aspects.| C | Notes | C | ===== | C | C*P* comments indicating place holders for which code is | C | presently being developed. | C \==========================================================/ C == Global variables === #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "CG2D.h" #include "MPI_INFO.h" C == Routine arguments == C myThid - Thread number for this instance of the routine. INTEGER myThid C == Local variables == INTEGER I Real*8 wTime1, wTime2 Real*8 fCount, fTime, fRate, wSetSize C-- Set model initial conditions CALL INITIALISE( myThid ) C-- Begin time stepping loop CALL CLOC(wTime1) DO I=1, nTimeSteps nIter = nIter0 + I CALL CG2D ENDDO CALL CLOC(wTime2) C CALL PLOT_FIELD_XYR8( cg2d_x , 'CG2D_X AFTER SOLVE') C CALL PLOT_FIELD_XYR8( cg2d_Ax, 'CG2D_AX AFTER SOLVE') C CALL PLOT_FIELD_XYR8( cg2d_b, 'CG2D_B AFTER SOLVE') C CALL PLOT_FIELD_XYR8( cg2d_r, 'CG2D_R AFTER SOLVE') WRITE(6,*) 'Wall clock time = ', wTime2-wTime1 fTime = wTime2-wTime1 fCount = DBLE(nTImeSteps)*DBLE(cg2dMaxIters)*34.D0*DBLE(Nx)*DBLE(Ny) fRate = fCount/fTime/1.D6 WRITE(6,*) 'PID ',myProcId,' OF ',numberOfProcs,' MFLOP/s = ', fRate wSetSize=DBLE((sNx+2*OLx)*(sNy+2*OLy)*8*11)/1024./1024. WRITE(6,*) 'PID ',myProcId,' OF ',numberOfProcs,' MB = ', wSetSize WRITE(6,'(4(1X,I4),3F10.4)') & numberOfProcs, myProcId, sNx, sNy, & fTime, fRate, wSetSize RETURN END C $Id: the_model_main.F,v 1.1 2006/05/12 21:58:06 ce107 Exp $