Skgit18 / FORTRAN-codes

FORTRAN program for basic concepts from Dynamic Meteorology
The Unlicense
1 stars 0 forks source link

Simplify write statements by replacing implied do loops with array sections #1

Open Beliavsky opened 2 weeks ago

Beliavsky commented 2 weeks ago

In geos.f90 you can rewrite

do i=2,14
  write(16,*)(e(j,i,3),j=2,16)
  write(17,*)(ug(j,i,3),j=2,16)
  write(18,*)(vg(j,i,3),j=2,16)
end do

as

do i=2,14
  write(16,*) e(2:16,i,3)
  write(17,*) ug(2:16,i,3)
  write(18,*) ug(2:16,i,3)
end do

The read statement in

  do i=1,15
  read(15,*)(z(j,i,k),j=1,17)
  end do

can be simplified in a similar way.

Skgit18 commented 2 weeks ago

Thank you for your suggestion! I will implement it in my next codes.