| 1 | subroutine plumes_wrapper (myTime, myIter, myThid) | 
| 2 | c----------------------------------------------------------------------- | 
| 3 | c  Subroutine plumes_wrapper - 'Wrapper' routine to interface | 
| 4 | c        with plumes driver. | 
| 5 | c        1) Set up "bi, bj loop"  and some timers and clocks. | 
| 6 | c        2) Call do_plumes - driver for plumes which computes tendencies | 
| 7 | c        3) Interpolate tendencies to dynamics grid | 
| 8 | c        4) Convert u,v tendencies to C-Grid | 
| 9 | c | 
| 10 | c Calls: do_plumes (get u,v,t,s tend, step tke, etc and tc, etc. forward) | 
| 11 | c        plume2dyn (4 calls - all plumes tendencies) | 
| 12 | c        AtoC (u and v tendencies) | 
| 13 | c----------------------------------------------------------------------- | 
| 14 | implicit none | 
| 15 | #include "CPP_OPTIONS.h" | 
| 16 | #include "SIZE.h" | 
| 17 | #include "GRID.h" | 
| 18 | #include "plumes_SIZE.h" | 
| 19 | #include "DYNVARS.h" | 
| 20 | #include "plumes_coms.h" | 
| 21 | #include "EEPARAMS.h" | 
| 22 |  | 
| 23 | integer myTime, myIter, myThid | 
| 24 |  | 
| 25 | integer bi, bj | 
| 26 | integer idim1, idim2, jdim1, jdim2 | 
| 27 |  | 
| 28 | idim1 = 1-OLx | 
| 29 | idim2 = sNx+OLx | 
| 30 | jdim1 = 1-OLy | 
| 31 | jdim2 = sNy+OLy | 
| 32 |  | 
| 33 | c Compute plumes increments | 
| 34 | CALL TIMER_START ('DO_PLUMES         [PLUME_WRAPPER]',mythid) | 
| 35 | do bi = myBxLo(myThid), myBxHi(myThid) | 
| 36 | call do_plumes(uplume,thplume,Nxplume,Nrplume,Nsx,bi, | 
| 37 | .                                              duplume,dthplume) | 
| 38 | enddo | 
| 39 | CALL TIMER_STOP ('DO_PLUMES         [PLUME_WRAPPER]',mythid) | 
| 40 |  | 
| 41 | CALL TIMER_START ('PLUME2DYN         [PLUME_WRAPPER]',mythid) | 
| 42 | do bj = myByLo(myThid), myByHi(myThid) | 
| 43 | do bi = myBxLo(myThid), myBxHi(myThid) | 
| 44 |  | 
| 45 | call plume2dyn(duplume,Nxplume,Nrplume,Nsx,Nsy,idim1,idim2, | 
| 46 | .    jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,guplume,gvplume) | 
| 47 | call plume2dyn(dthplume,Nxplume,Nrplume,Nsx,Nsy,idim1,idim2, | 
| 48 | .    jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,gthplume) | 
| 49 |  | 
| 50 | enddo | 
| 51 | enddo | 
| 52 | CALL TIMER_STOP ('PLUME2DYN         [PLUME_WRAPPER]',mythid) | 
| 53 |  | 
| 54 | c Convert guplume and gvplume from A-grid to C-grid for use by dynamics | 
| 55 | CALL TIMER_START ('ATOC              [PLUME_WRAPPER]',mythid) | 
| 56 | call AtoC(myThid,guplume,gvplume,maskC,im1,im2,jm1,jm2,Nr, | 
| 57 | .                      Nsx,Nsy,1,sNx,1,sNy,guplume,gvplume) | 
| 58 | CALL TIMER_STOP ('ATOC              [PLUME_WRAPPER]',mythid) | 
| 59 |  | 
| 60 | CALL TIMER_START ('EXCHANGES         [PLUME_WRAPPER]',mythid) | 
| 61 | c Call the c-grid exchange routine to fill in the halo regions (du,dv) | 
| 62 | call exch_uv_xyz_RL(guplume,gvplume,.TRUE.,myThid) | 
| 63 | c Call the a-grid exchange routine to fill in the halo regions (dth,ds) | 
| 64 | call exch_RL_cube(gthplume,OLx, OLx, OLy, OLy, Nr,OLx, OLy, | 
| 65 | .            FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) | 
| 66 | CALL TIMER_STOP ('EXCHANGES         [PLUME_WRAPPER]',mythid) | 
| 67 |  | 
| 68 | return | 
| 69 | end |