Opened 4 years ago

Closed 4 years ago

# trouble understanding init_domainfill.f90

Reported by: Owned by: nehstand minor FP coding/compilation FLEXPART 10.4

Hello,

I am trying to understand the initialization of particles in init_domainfill.f90. I'm having trouble understanding the following lines (54 to 57) :

```  nx_we(1)=max(int(xpoint1(1)),0)
nx_we(2)=min((int(xpoint2(1))+1),nxmin1)
ny_sn(1)=max(int(ypoint1(1)),0)
ny_sn(2)=min((int(ypoint2(1))+1),nymin1)
```

As far as I understand nx_we, ny_sn are the grid indices for western, eastern, southern and northern boundary of the release domain.

My question is the following : what happens if one of the longitudes and/or latitudes bounding the domain are negative? That is if one of xpoint1, xpoint2, ypoint1, ypoint2 < 0 ?
It seems to me that these code lines restrict our domain to positive values. However, I know from experience, when using Flexpart, that there is no such restriction.

### comment:1 Changed 4 years ago by ignacio

The indices of the Flexpart internal grid are nonnegative.
Geographical input coordinates are converted to this internal grid in order to perform the calculations.
For example, the RELEASES coordinates are converted in lines 34-39 of subroutine coordtrafo.

```do i=1,numpoint
xpoint1(i)=(xpoint1(i)-xlon0)/dx
xpoint2(i)=(xpoint2(i)-xlon0)/dx
ypoint1(i)=(ypoint1(i)-ylat0)/dy
ypoint2(i)=(ypoint2(i)-ylat0)/dy
end do
```
Last edited 4 years ago by pesei (previous) (diff)

### comment:2 Changed 4 years ago by ignacio

• Priority changed from major to minor
• Resolution set to fixed
• Status changed from new to closed

### comment:3 Changed 4 years ago by pesei

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