1 / 19

Note about Cpl7 and WRF

Note about Cpl7 and WRF. Juanxiong He ARSC and IARC jhe@iarc.uaf.edu. The difference between Cpl6 and Cpl7. Cpl6 uses MPH to organize the framework of the couple model, but Cpl7 uses MPI group communicator. Cpl6 is concurrent, but Cpl7 is sequential. Cpl6 is MPMD, but Cpl7 is SPMD.

vlora
Download Presentation

Note about Cpl7 and WRF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu

  2. The difference between Cpl6 and Cpl7 • Cpl6 uses MPH to organize the framework of the couple model, but Cpl7 uses MPI group communicator. • Cpl6 is concurrent, but Cpl7 is sequential. • Cpl6 is MPMD, but Cpl7 is SPMD. • In Cpl6 the communication process is embedded in the component integration process and the component is also responsible for data transferring. But in Cpl7 they are separated. All communication processes are taken over by Cpl7 and the component runs itself without taking care of data transferring. It’s better for model development.

  3. partition of the processors In RACM MPI_COMM_WORLD CPLICE CPLATM ICE ATM CPL CPLLND CPLATM LND OCN 5 COMPONENTS 10 COMMUNICATION GROUPS

  4. Partition of the processors in RACM is the similar as Cpl7 and CCSM4 ! Initialize call mpi_init(ierr) call mpi_comm_rank(MPI_COMM_WORLD, mype , ierr) call mpi_comm_size(MPI_COMM_WORLD, numpes, ierr) ! Create MPI communicator groups call seq_comm_setcomm(ATMID,…) ! Atmoshere call seq_comm_setcomm(LNDID, …) ! Iand call seq_comm_setcomm(ICEID, …) ! Seaice call seq_comm_setcomm(OCNID, …) ! Ocean call seq_comm_setcomm(CPLID, …) ! Coupler call seq_comm_joincomm(CPLID,ATMID,CPLATMID) ! Atmoshere and coupler call seq_comm_joincomm(CPLID,LNDID,CPLLNDID) ! Land and coupler call seq_comm_joincomm(CPLID,ICEID,CPLICEID) ! Seaice and coupler call seq_comm_joincomm(CPLID,OCNID,CPLOCNID) ! Ocean and coupler ! Initialize MCT call mct_world_init(10, MPI_COMM_WORLD, comms, comps) MPI code example

  5. RACM Coupling flow • The model is controlled by the driver • The coupling process has three phases in each four components: importing, running and exporting • Two sub steps: at first, ocean, seaice and land finish importing, running and exporting; then, atmosphere imports, runs and export, since atmosphere needs the surface data from land, seaice and ocean. • Two implications at present: all the component has the same couple interval and their timesteps are equal to or less than couple interval

  6. Begin OCN LND ICE ATM CPL init init init init init ESMF Clock advance ESMF Clock advance ESMF Clock advance ESMF Clock advance ESMF Clock advance Map, merge For Ocean receive CPLOCN send Reaarange and Ocean import Map, merge For Land Ocean run CPLLND receive send Rearrange and Land import Land run Map, merge For Ice CPLICE receive send Seaice run Rearrange and Ice import

  7. ICE OCN LND ATM CPL CPLOCN send receive Rearrange and Ocean Export Accumulate For Ocean CPLICE send receive Rearrange Ice Export Acumulate For Ice CPLLND receive send Rearrange and Land Export Acumulate For Land

  8. CPL OCN LND ICE ATM Merge For Atm CPLATM receive send Rearrange and Atm Import receive Rearrange and Atm Export Atm run send CPLATM Acumulate For Atm Stop time? Stop time? Stop time? Stop time? Stop time? End

  9. CCSM4 clock mechanism • RACM has two sets of clocks. One is the ESMF clock, which controls the coupling process; the other is the internal clock in each components, which controls the integration. • Every pe has five ESMF clocks: Eclock_d (driver), Eclock_a (atmospher), Eclock_o (ocean), Eclock_l (land), Eclock_i (seaice). • The ESMF clock advances one step with the couple interval timestep. • Each component has its internal clock, which advances one step with integral timestep. • The component exports data and Cpl7 transfer data if the internal clock matches the ESMF clock.

  10. ! initialize seq_syncclock, Eclock_d, Eclock_i, Eclock_o, Eclock_l, Eclock_a call ESMF_Initialize() ! Advance clock call seq_timemgr_clockAdvance( seq_SyncClock) … ! Initialze internal clock call timemgr_init(…) ! advance the internal clock call advance_timestep() ! Compare ESMF clock and internal clock call get_curr_date( yr, mon, day, tod ) ymd = yr*10000 + mon*100 + day tod = tod dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) Clock code example

  11. Data flow of the coupling process in each component • The component doesn’t import from or export to the coupler actively. It’s that the coupler transfers data into or out of the component. • By the union communication group of the coupler and the component, the coupler uses the MCT function “rearrange” to get and put the data. • The rearranged data has the same value and feature with the original except the palace of pe. So the rearrange process is very fast. • The coupler remaps or merges the incoming data for the sake of the coupling among different componet.

  12. Data flow of the coupling process in each component • Atmosphere: x2a_aa (import data) a2x_aa (export data) • Ocean: x2o_oo (import data) o2x_xx (export data) • Seaice: x2i_ii (import data) i2x_ii (export data) • Land: x2l_ll (import data) l2x_ll (export data)

  13. CPLOCNID CPLATMID CPLLNDID CPLICEID l2x_ll o2x_oo a2x_aa i2x_ii component exporting fields to CPL Rearrange a2x_ax o2x_ox i2x_ax l2x_lx Map a2x_ox l2x_ax o2x_ax i2x_ax preparing fiedls for atmosphere on CPL xao_ox xao_ax CPLID Merge x2a_ax Importing fiedls from CPL for atmosphere Rearrange x2a_aa ATMOSPHERE CPLATMID

  14. CPLOCNID CPLATMID CPLLNDID CPLICEID r2x_rr o2x_oo a2x_aa i2x_ii component exporting fields to CPL Rearrange a2x_ax o2x_ox i2x_ix r2x_rx Map a2x_ox r2x_ox xao_ox i2x_ox preparing fiedls for ocean on CPL fractions_ox X2o_ox CPLID Merge X2oacc_ox%data Importing fiedls from CPL for Ocean Rearrange OCEAN x2o_oo CPLOCNID

  15. CPLOCNID CPLATMID o2x_oo a2x_aa component exporting fields to CPL Rearrange a2x_ax o2x_ox Map o2x_ix preparing fiedls for seaice on CPL a2x_ix Merge CPLID X2i_ix Rearrange Importing fiedls from CPL for seaice X2i_ii LAND CPLOCNID

  16. CPLATMID a2x_aa component exporting fields to CPL Rearrange a2x_lx Map CPLID preparing fiedls for seaice on CPL X2l_lx Rearrange x2l_ll Importing fiedls from CPL for seaice CPLLNFID SEAICE

  17. if (iamin_CPLID .and. atm_prognostic) then call map_ocn2atm_mct ! o2x_ox ->o2x_ax, xao_ox->xao_ax call map_ice2atm_mct !l2x_ix ->i2x_ax call map_lnd2atm_mct !l2x_lx ->l2x_ax call mrg_x2a_run_mct ! l2x_ax+o2x_ax+xao_ax+i2x_ax+fractions_ax->x2a_ax endif if (iamin_CPLATMID .and. atm_prognostic) then call map_atmx2atma_mct ! x2a_ax -> x2a_aa endif ! Rearrange and import call atm_run_mct( EClock_a, cdata_aa, x2a_aa, a2x_aa) !export a2x_aa if (iamin_CPLATMID) then call map_atma2atmx_mct !a2x_aa->a2x_ax ! Rearrange and export endif if (iamin_CPLID) then call mct_avect_vecmult(a2x_ax,mdl2drv_ax,seq_flds_a2x_fluxes) !acumulate endif a Code sample of Import and export of atmosphere couple data

  18. Some Changes of Cpl7 and WRF for the sake of RACM at present and in future • Reorganizing WRF upper structure to be fit for coupling. • Changing the the related Cpl7 atmosphere land couple subroutine and allow the LSM has a different grid. It has more flexible since the grids of WRF and LSM are often different. Any resolution change in LSM may bring arduous work of adjusting the parameters. • The decomposition of the grid in WRF has halo, but Cpl7 doesn’t consider it. Adaption of Cpl7 for halo will be necessary. • The couple time interval of the different model should be different for RACM. The couple time interval of VIC in RACM is one day. But the fine scale of NAPC needs get the data every one hour or even 15 minutes .

  19. Reorganizing of WRF integral process wrf_init ----- atm_init_mct(Eclock, cdata_a, x2a_a, a2x_a) Wrap Wrf_init with the related coupler data and initialize it wrf_run----- atm_run_mct(Eclock,cdata_a,x2a_a, a2x_a) • Wrap Wrf_run with atm_import_mct and atm_export_mct, make wrf_run run until the couple time is ok • reorganize the wrf_run into three parts and throw wrf land surface model: wrf_run1, undertaking dynamic integral; wrf_run2, calculating radiation; wrf_run3, calculating other physic process Destroy the related coupler data and wrf data Wrf_finalize----- atm_final_mct()

More Related