anchor.diff:    b = 0d0
   
     do k = 1, layers ! move through the different layers of the model
  -    do j=1, ny ! move through longitude
  -      do i=1, nx ! move through latitude
  +    do j = 1, ny ! move through longitude
  +      do i = 1, nx ! move through latitude
           ! The following loops are to get the pressure term in the
           ! Bernoulli Potential
           b_proto = 0d0
  
positive.code:   integer nx, ny, layers, n, i, j, k
    double precision data(0:nx+1, 0:ny+1, layers)
  
    do k=1, layers
      do j=1, ny
        do i=1, nx
          if (data(i,j,k) .ne. data(i,j,k)) then
            ! write a file saying so
            open(unit=10, file='NaN detected.txt', action="write", &
  
negative.code:   read(8, nml=GRID)
    read(8, nml=INITIAL_CONDITONS)
    read(8, nml=EXTERNAL_FORCING)
    close(unit=8)
  
    nwrite = int(dumpFreq/dt)
    avwrite = int(avFreq/dt)
  
    ! Pi, the constant
    pi = 3.1415926535897932384
    ! Zero vector - for internal use only
    zeros = 0d0
  
  