Coupled WRF/ROMS can be run in two modes; sequential and concurrent. In concurrent, some of the processors execute WRF and the others execute ROMS. The way ROMS is setup right now works fine for that. However, in sequential mode, I run into difficulty. Here, all processors execute ROMS then all processors execute WRF then ROMS then WRF, etc. In this mode, we need to have an INIT, RUN and FINALIZE interface
for each model. That way, the coupler driver program can be written as follows:
Code: Select all
CALL init_ROMS
CALL init_WRF
DO i=1,Nsteps
CALL run_ROMS
CALL run_WRF
END DO
CALL finalize_ROMS
CALL finalize_WRF
Code: Select all
CALL init_ROMS
CALL init_WRF
run_interval=1.0*secods_per_hour
hours_to_run=6.0*seconds_per_hour
Nsteps=hours_to_run/run_interval
DO i=1,Nsteps
CALL run_ROMS (run_interval)
CALL run_WRF (run_interval)
END DO
CALL finalize_ROMS
CALL finalize_WRF
Code: Select all
coupling_interval=1.0*seconds_per_hour
run_interval=6.0*seconds_per_hour
IF (I_AM_A_ROMS_PROCESSOR) THEN
CALL init_ROMS
CALL run_ROMS (run_interval, coupling_interval)
CALL finalize_ROMS
ELSE
CALL init_WRF
CALL run_WRF (run_interval, coupling_interval)
CALL finalize_WRF
END IF
Code: Select all
CALL init_ROMS (ROMS_STATE)
CALL init_WRF (WRF_STATE)
CALL init_couple_WRF_to_ROMS (ROMS_STATE, WRF_STATE, WRF_TO_ROMS_STATE)
CALL init_couple_ROMS_to_WRF(ROMS_STATE, WRF_STATE, ROMS_TO_WRF_STATE)
run_interval=1.0*seconds_per_hour
hours_to_run=6.0*seconds_per_hour
Nsteps=hours_to_run/run_interval
DO i=1,Nsteps
CALL run_ROMS (ROMS_STATE, run_interval)
CALL couple_ROMS_to_WRF (ROMS_STATE, WRF_STATE, ROMS_TO_WRF_STATE)
CALL run_WRF (WRF_STATE, run_interval)
CALL couple_WRF_to_ROMS (WRF_STATE, ROMS_STATE, WRF_TO_ROMS_STATE)
END DO
Here is how it looks for concurrent mode:
Code: Select all
IF (I_AM_A_ROMS_PROCESSOR) THEN
CALL init_ROMS (ROMS_STATE)
ELSE
CALL init_WRF(WRF_STATE)
END IF
CALL init_couple_WRF_to_ROMS (ROMS_STATE, WRF_STATE, WRF_TO_ROMS_STATE)
CALL init_couple_ROMS_to_WRF (ROMS_STATE, WRF_STATE, ROMS_TO_WRF_STATE)
run_interval=1.0*seconds_per_hour
hours_to_run=6.0*seconds_per_hour
Nsteps=hours_to_run/run_interval
DO i=1,Nsteps
IF (I_AM_A_ROMS_PROCESSOR) THEN
CALL run_ROMS (ROMS_STATE, RUN_INTERVAL)
ELSE
CALL run_WRF (WRF_STATE, RUN_INTERVAL)
END IF
CALL couple_ROMS_to_WRF (ROMS_STATE, WRF_STATE, ROMS_TO_WRF_STATE)
CALL couple_WRF_to_ROMS (WRF_STATE, ROMS_STATE, WRF_TO_ROMS_STATE)
END DO