Download presentation
Presentation is loading. Please wait.
Published byGwendoline Allen Modified over 9 years ago
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
ATM LNDOCN CPL ICE MPI_COMM_WORLD CPLATM CPLLND CPLICE 5 COMPONENTS 10 COMMUNICATION GROUPS partition of the processors In RACM
4
! 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) Partition of the processors in RACM is the similar as Cpl7 and CCSM4 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
Ocean run ESMF Clock advance Begin
7
OCNLND ICE CPLATM Accumulate For Ocean receivesend Rearrange and Ocean Export Acumulate For Ice receive Rearrange Ice Export send receive CPLOCN CPLLND CPLICE Acumulate For Land Rearrange and Land Export send
8
Merge For Atm Acumulate For Atm receive send Rearrange and Atm Import Rearrange and Atm Export send OCNLNDICE CPL ATM Atm run Stop time? End CPLATM
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
component exporting fields to CPL Importing fiedls from CPL for atmosphere preparing fiedls for atmosphere on CPL l2x_lx o2x_ox a2x_ax i2x_ax l2x_ax o2x_ax i2x_ax x2a_ax x2a_aa l2x_ll o2x_oo a2x_aa i2x_ii CPLID Merge Map Rearrange CPLATMID CPLLNDIDCPLICEID CPLATMIDCPLOCNID Rearrange xao_ax xao_ox a2x_ox ATMOSPHERE
14
component exporting fields to CPL Importing fiedls from CPL for Ocean preparing fiedls for ocean on CPL r2x_rx o2x_ox a2x_ax i2x_ix r2x_ox i2x_ox X2oacc_ox%data x2o_oo r2x_rr o2x_oo a2x_aa i2x_ii CPLIDMerge Map Rearrange CPLOCNID CPLLNDIDCPLICEID CPLATMIDCPLOCNID Rearrange X2o_ox xao_ox a2x_ox fractions_ox OCEAN
15
component exporting fields to CPL Importing fiedls from CPL for seaice preparing fiedls for seaice on CPL o2x_ox a2x_ax X2i_ii o2x_oo a2x_aa CPLID Merge Map Rearrange CPLOCNID CPLATMIDCPLOCNID Rearrange X2i_ix o2x_ix a2x_ix LAND
16
component exporting fields to CPL Importing fiedls from CPL for seaice preparing fiedls for seaice on CPL a2x_lx x2l_ll a2x_aa CPLID Map Rearrange CPLLNFID CPLATMID Rearrange X2l_lx 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) wrf_run----- atm_run_mct(Eclock,cdata_a,x2a_a, a2x_a) Wrf_finalize----- atm_final_mct() Wrap Wrf_init with the related coupler data and initialize it (1)Wrap Wrf_run with atm_import_mct and atm_export_mct, make wrf_run run until the couple time is ok (2)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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.