C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/model/src/do_the_model_io.F,v 1.2 1998/04/24 02:05:40 cnh Exp $ #include "CPP_EEOPTIONS.h" SUBROUTINE DO_THE_MODEL_IO(myIter, myThid) C /==========================================================\ C | SUBROUTINE DO_THE_MODEL_IO | C | o Controlling routine for IO in model main time-stepping | C | loop. | C |==========================================================| C | Many systems do not have thread safe IO so it is easier | C | to lump everything together and do dumping of fields | C | and updating of forcing terms in a single place. | C | The approach to IO used here is that writes are only | C | performed by thread 1 and that a process only writes out | C | its data ( since it doen't know about anyone elses data!)| C | Reading on the other hand is assumed to be from a file | C | containing all the data for all the processes. Only the | C | portion of data of interest to this process is actually | C | loaded. To work well this assumes the existence of some | C | reliable tool to join datasets together at the end of a | C | run. | C | Notes | C | ===== | C | We allow thread 2-nThreads to continue whilst thread 1 | C | does IO. The assumption is that the other threads won't | C | do anything to update their interior regions before | C | thread 1 has finished writing them out. | C \==========================================================/ C == Global variables === #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "DYNVARS.h" #include "CG2D.h" C == Routine arguments == C myThid - Thread number for this instance of the routine. C myIter - Iteration number INTEGER myThid INTEGER myIter C == Local variables == C-- Generaly only thread 1 does IO here. It can't start until everyone's C-- fields are ready. IF ( MOD(myIter,10) .NE. 0 ) RETURN _BARRIER C-- Write "text-plots" of certain fields CALL PLOT_FIELD_XYZR8( uVel , 'uVel ' , Nz, myIter, myThid ) CALL PLOT_FIELD_XYZR8( vVel , 'vVel ' , Nz, myIter, myThid ) CALL PLOT_FIELD_XYZR8( theta, 'Theta ' , Nz, myIter, myThid ) CALL PLOT_FIELD_XYZR8( rho, 'rho ' , Nz, myIter, myThid ) CALL PLOT_FIELD_XYR8( cg2d_x, 'cg2d_x ' , myIter, myThid ) _BARRIER C RETURN END