| 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 in vertical | 
| 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 "gridalt_mapping.h" | 
| 22 | #include "EEPARAMS.h" | 
| 23 |  | 
| 24 | integer myTime, myIter, myThid | 
| 25 |  | 
| 26 | integer bi, bj | 
| 27 | integer idim1, idim2, jdim1, jdim2 | 
| 28 |  | 
| 29 | idim1 = 1-OLx | 
| 30 | idim2 = sNx+OLx | 
| 31 | jdim1 = 1-OLy | 
| 32 | jdim2 = sNy+OLy | 
| 33 |  | 
| 34 | c Compute plumes increments | 
| 35 | CALL TIMER_START ('DO_PLUMES         [PLUME_WRAPPER]',mythid) | 
| 36 | do bj = myByLo(myThid), myByHi(myThid) | 
| 37 | do bi = myBxLo(myThid), myBxHi(myThid) | 
| 38 | call do_plumes(uplume,vplume,thplume,splume,Nxplumes,Nyplumes, | 
| 39 | .           Nr,Nsx,Nsy,bi,bj,duplume,dvplume,dthplume,dsplume) | 
| 40 | enddo | 
| 41 | enddo | 
| 42 | CALL TIMER_STOP ('DO_PLUMES         [PLUME_WRAPPER]',mythid) | 
| 43 |  | 
| 44 | CALL TIMER_START ('PLUME2DYN         [PLUME_WRAPPER]',mythid) | 
| 45 | do bj = myByLo(myThid), myByHi(myThid) | 
| 46 | do bi = myBxLo(myThid), myBxHi(myThid) | 
| 47 |  | 
| 48 | call plume2dyn(duplume,Nxplumes,Nyplumes,Nr,Nsx,Nsy, | 
| 49 | .    idim1,idim2,jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,guplume) | 
| 50 | call plume2dyn(dvplume,Nxplumes,Nyplumes,Nr,Nsx,Nsy, | 
| 51 | .    idim1,idim2,jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,gvplume) | 
| 52 | call plume2dyn(dthplume,Nxplumes,Nyplumes,Nr,Nsx,Nsy, | 
| 53 | .    idim1,idim2,jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,gthplume) | 
| 54 | call plume2dyn(dsplume,Nxplumes,Nyplumes,Nr,Nsx,Nsy, | 
| 55 | .    idim1,idim2,jdim1,jdim2,Nr,Nsx,Nsy,1,sNx,1,sNy,bi,bj,gsplume) | 
| 56 |  | 
| 57 | enddo | 
| 58 | enddo | 
| 59 | CALL TIMER_STOP ('PLUME2DYN         [PLUME_WRAPPER]',mythid) | 
| 60 |  | 
| 61 | c Convert guplume and gvplume from A-grid to C-grid for use by dynamics | 
| 62 | CALL TIMER_START ('ATOC              [PLUME_WRAPPER]',mythid) | 
| 63 | call AtoC(myThid,guplume,gvplume,maskC,im1,im2,jm1,jm2,Nr, | 
| 64 | .                      Nsx,Nsy,1,sNx,1,sNy,guplume,gvplume) | 
| 65 | CALL TIMER_STOP ('ATOC              [PLUME_WRAPPER]',mythid) | 
| 66 |  | 
| 67 | CALL TIMER_START ('EXCHANGES         [PLUME_WRAPPER]',mythid) | 
| 68 | c Call the c-grid exchange routine to fill in the halo regions (du,dv) | 
| 69 | call exch_uv_xyz_RL(guplume,gvplume,.TRUE.,myThid) | 
| 70 | c Call the a-grid exchange routine to fill in the halo regions (dth,ds) | 
| 71 | call exch_RL_cube(gthplume,OLx, OLx, OLy, OLy, Nr,OLx, OLy, | 
| 72 | .            FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) | 
| 73 | call exch_RL_cube(gsplume,OLx, OLx, OLy, OLy, Nr,OLx, OLy, | 
| 74 | .            FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) | 
| 75 | CALL TIMER_STOP ('EXCHANGES         [PLUME_WRAPPER]',mythid) | 
| 76 |  | 
| 77 | return | 
| 78 | end |