Opened 5 years ago

#236 new Defect

Bad wind_option / time_option combination is not forbidden by WRF-FLEXPART

Reported by: ahilboll Owned by:
Priority: major Milestone:
Component: FP other Version: FLEXPART-WRF
Keywords: Cc:

Description

FLEXPART-WRF 3.3.2 does not prevent time_option == 1 from being used with wind_option /= 1.

According to Brioude et al. 2013 (doi:10.5194/gmd-6-1889-2013), time_option=1 is meant to be used with wind_option=1 (time-averaged winds). However, the source code does not enforce this.

The problem is that in getfields.f90, readwind_timeav is being called when time_option == 1 and wind_option == 1. After that, readwind is being called no matter what.

Within readwind, the u, v, and w fields are only read from wrfout files if time_option == 0. This means that when the user uses wind_option /= 1 together with time_option = 1, there is no u, v, and w ever read from wrfout files.

At a later point in readwind, the surface layer of u and v is being overwritten with u10 and v10. Therefore, particles are being moved by wind as long as they stay in the surface layer. As soon as they leave the surface layer, they are in a layer where u==v==0 (since gfortran compilation uses -finit-local-zero), which means the particle will not move significantly afterwards.

The following code adds a check to readinput.f90 to prevent the model from running with this bad parameter combination:

diff --git a/readinput.f90 b/readinput.f90
index 48a435d..dddad01 100644
--- a/readinput.f90
+++ b/readinput.f90
@@ -586,6 +586,15 @@ subroutine readinput
     stop
   endif
 
+  ! time_option=1 prevents uu and vv from being read in readwinds, so
+  ! there is no uu and vv at all
+  !***************************************************************************
+  if ((time_option.eq.1) .and. (wind_option.ne.1)) then
+    write(*,*) ' #### FLEXPART MODEL ERROR!                             #### '
+    write(*,*) ' #### TIME_OPTION=1 can only be used with WIND_OPTION=1 #### '
+    stop
+  endif
+
 ! iouttype -- convert negative values to 0; positive out of range values to 2
   if (iouttype .lt. 0) iouttype = 0
   if (iouttype .gt. 2) iouttype = 2

Change History (0)

Note: See TracTickets for help on using tickets.
hosted by ZAMG