#include "common.h"
#include "ocean.h"

#if PROTOTYPE_ALLOWED
void main(int argc, char *argv[])
#else
void main(argc, argv)
int argc;
char *argv[];  /* test for ATG */
#endif
{
     double S = 40;
     double T = 40;
     double P = 10000;

   if (argc != 4)
   {
      printf("\n USAGE: atg <salinity> <temperature> <pressure>");
      printf("\n EXAMPLE: atg 40.0 40.0 10000.0\n");
   }
   else
   {
      S = atof(argv[1]);
      T = atof(argv[2]);
      P = atof(argv[3]);
   }
   printf("\n The adiabatic temperature gradient is %E C/dbar", ATG(S,T,P));
   printf("\n when S = %g (PSS-78), T = %g deg C, and P = %g dbar.\n\n", S, T, P);
}
