Opened 6 years ago

Last modified 6 years ago

#198 accepted Enhancement

Unsorted trajectories in FLEXTRA flightmode with constant initialization time

Reported by: anphi Owned by: pesei
Priority: minor Milestone:
Component: FLEXTRA Version:
Keywords: Cc:

Description (last modified by pesei)

For a project we did some simulations in flight mode with FLEXTRA. The specific characteristic was, that we hold the time and horizontal coordinates constant and just varied the vertical coordinate.

This lead to the following STARTFLIGHT file:

... header ...
**********************************************************************
alife
1 !kind
1 !unit
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
1121.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
896.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
671.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
446.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
221.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20170422 060000 !time begin
32.97000 !lon
35.43000 !lat
131.0 !height 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reading of the first trajectory starting point from this file is done in FLEXTRA.f line 99.
Afterwards, the rest is read in the following timemanager.f section (l. 114 - 162):

C Check whether new trajectories have to be started
C 1nd if: check if time within modeling period
C 2nd if: check if the interval interv has passed by (for NORMAL
C         trajectories) or if a FLIGHT traj. is due to be started
*****************************************************************

        if (abs(itime).le.abs(ideltas-lentra)) then
          if (modecet.eq.3) then       ! FLIGHT mode
41          continue
            if ((nextflight.eq.itime).and.(numtra.lt.maxtra)) then
              do 43 i=numtra,1,-1         ! shift pointers
43              numb(i+1)=numb(i)
              numtra=numtra+1             ! increase number of traj.

              j=1                         ! initialize FLIGHT traj.
42            continue
              if (nttra(j).eq.0) then
                numb(1)=j
                npoint(j)=1
                levmem(j)=zpoint(1)
                xtra(j,1)=xpoint(1)
                ytra(j,1)=ypoint(1)
                ztra(j,1)=zpoint(1)
                ittra(j,1)=itime
                nttra(j)=1
                kind(j)=kind(1)
                kindz(j)=kindz(1)
              else 
                j=j+1
                if (j.gt.maxtra) stop 'timemanager: too many trajectorie
     +s. Increase parameter maxtra and re-start'
                goto 42
              endif

C Read the next FLIGHT traj. 
****************************

              read(unitpoin,*,err=15,end=15) ldat,ltim
              read(unitpoin,*,err=15,end=15) xpoint(1)
              read(unitpoin,*,err=15,end=15) ypoint(1)
              read(unitpoin,*,err=15,end=15) zpoint(1)
              read(unitpoin,*,err=15,end=15)
              nextflight=nint(sngl(juldate(ldat,ltim)-bdate)*86400.)
              call coordtrafo(error)
              if (error) stop
              call subtractoro()
              if (kindz(1).eq.3) zpoint(1)=zpoint(1)*100.

              goto 41
            endif


The problem in this section is, that the vertical order isn't maintained.
The new trajectory is stored in the next free memory which is found. It might not be a problem if the time is increasing, but seems to have a problem with a constant time.

This unordered storage of trajectories are then written out to the output file in this wrong order. This might not be a problem for most cases. But it matters in our case where the output trajectories are processed one by one, assuming the correct order of trajectories regaring the height.

Change History (2)

comment:1 Changed 6 years ago by pesei

  • Owner set to pesei
  • Status changed from new to accepted
  • Type changed from Task to Enhancement
  • Version flexpart 6.0 deleted

comment:2 Changed 6 years ago by pesei

  • Description modified (diff)
Note: See TracTickets for help on using tickets.
hosted by ZAMG