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

#if PROTOTYPE_ALLOWED
void main(int argc, char *argv[])
#else
void main(argc, argv)
int argc;
char *argv[];
#endif
{
   double P = 10000.0, T = 40.0, S = 40.0, PR = 0.0;

   if (argc != 5)
   {
      printf("\n USAGE: theta <salinity> <temperature> <pressure> <reference-pressure>");
      printf("\n EXAMPLE: theta 40.0 40.0 10000.0 0.0\n");
   }
   else
   {
      S = atof(argv[1]);
      T = atof(argv[2]);
      P = atof(argv[3]);
      PR = atof(argv[4]);
   }
   printf("\n potential temperature = %f deg C", THETA(S, T, P, PR));
   printf("\n for S = %g (PSS-78), T = %g deg C, P = %g dbar, ref P = %g dbar\n\n", S, T, P, PR);
}

