+ All Categories
Home > Documents > Note about Cpl7 and WRF Juanxiong He ARSC and IARC [email protected].

Note about Cpl7 and WRF Juanxiong He ARSC and IARC [email protected].

Date post: 19-Jan-2016
Category:
Upload: gwendoline-allen
View: 214 times
Download: 0 times
Share this document with a friend
Popular Tags:
19
Note about Cpl7 and WRF Juanxiong He ARSC and IARC [email protected]
Transcript
Page 1: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

Note about Cpl7 and WRF

Juanxiong HeARSC and IARC

[email protected]

Page 2: 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.

• 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.

Page 3: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

ATM

LND OCN

CPL

ICE

MPI_COMM_WORLD

CPLATM

CPLATMCPLLND

CPLICE

5 COMPONENTS10 COMMUNICATION GROUPS

partition of the processors In RACM

Page 4: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

! 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 groupscall seq_comm_setcomm(ATMID,…) ! Atmoshere call seq_comm_setcomm(LNDID, …) ! Iandcall seq_comm_setcomm(ICEID, …) ! Seaicecall seq_comm_setcomm(OCNID, …) ! Oceancall 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

Page 5: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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

Page 6: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

Ocean run

ESMF Clock advance

Map, mergeFor Ocean

receive sendReaarange and Ocean importMap, merge

For Land

receive

Rearrange and Land import

send

Land run

receive

Seaice run

OCN LND ICE CPL

CPLOCN

CPLLND

CPLICE Map, mergeFor Ice

Rearrange and Iceimport

send

ESMF Clock advance

ESMF Clock advance

ESMF Clock advance

init init init initATM

ESMF Clock advance

init

Begin

Page 7: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

OCN LND ICE CPLATM

AccumulateFor Ocean

receivesendRearrange and Ocean Export

AcumulateFor Ice

receiveRearrange Ice Export

send

receive

CPLOCN

CPLLND

CPLICE

AcumulateFor Land

Rearrange and LandExport

send

Page 8: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

MergeFor Atm

AcumulateFor Atm

receive

receive sendRearrange and Atm Import

Rearrange and Atm Export

send

OCN LND ICE CPLATM

Atm run

Stop time? Stop time?Stop time?Stop time?Stop time?

End

CPLATM

CPLATM

Page 9: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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.

Page 10: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

! 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

Page 11: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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.

Page 12: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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)

Page 13: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

component exporting fields to CPL

Importing fiedls from CPL for atmosphere

preparing fiedls for atmosphereon 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

CPLLNDID CPLICEIDCPLATMIDCPLOCNID

Rearrange

xao_ax

xao_ox

a2x_ox

ATMOSPHERE

Page 14: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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

CPLID Merge

Map

Rearrange

CPLOCNID

CPLLNDID CPLICEIDCPLATMIDCPLOCNID

Rearrange

X2o_ox

xao_ox

a2x_ox

fractions_ox

OCEAN

Page 15: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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

Page 16: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

component exporting fields to CPL

Importing fiedls from CPL for seaice

preparing fiedls for seaice on CPL

a2x_lx

x2l_ll

a2x_aa

CPLIDMap

Rearrange

CPLLNFID

CPLATMID

Rearrange

X2l_lx

SEAICE

Page 17: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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) thencall mct_avect_vecmult(a2x_ax,mdl2drv_ax,seq_flds_a2x_fluxes) !acumulateendif

a Code sample of Import and export of atmosphere couple data

Page 18: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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 .

Page 19: Note about Cpl7 and WRF Juanxiong He ARSC and IARC jhe@iarc.uaf.edu.

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


Recommended