Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_CplComp) | :: | comp | ||||
type(ESMF_State) | :: | importState | ||||
type(ESMF_State) | :: | exportState | ||||
type(ESMF_Clock) | :: | clock | ||||
integer | :: | rc |
subroutine user_run(comp, importState, exportState, clock, rc) type(ESMF_CplComp) :: comp type(ESMF_State) :: importState, exportState type(ESMF_Clock) :: clock integer :: rc ! Local variables type(ESMF_Field) :: humidity1, humidity2 print *, "User Coupler Run starting" ! Get input data call ESMF_StateGetField(importState, "humidity", humidity1, rc=rc) if (rc .ne. ESMF_SUCCESS) goto 10 ! call ESMF_FieldPrint(humidity1, rc=rc) ! Get location of output data call ESMF_StateGetField(exportState, "humidity", humidity2, rc=rc) if (rc .ne. ESMF_SUCCESS) goto 10 ! call ESMF_FieldPrint(humidity2, rc=rc) ! These are fields on different IGrids - call Regrid to rearrange ! the data. The communication pattern was computed at init, ! this simply has to execute the send and receive equivalents. call ESMF_FieldRegrid(humidity1, humidity2, routehandle, rc=rc) if (rc .ne. ESMF_SUCCESS) goto 10 ! Data is moved directly to the field in the output state, so no ! "put" is needed here. print *, "User Coupler Run returning" rc = ESMF_SUCCESS return ! only come here on error 10 continue rc = ESMF_FAILURE end subroutine user_run